-2

Why and What purpose use this <?= ?> syntax in cakephp

code example

<h1>
    Getting All bookmarks with certain Tags:
    <?= $this->Text->toList( $tags ); ?>
</h1>

<section>
    <?php foreach ( $bookmarks as $bookmark ) { ?>
        <article>
            <h4><?= $this->Html->link( $bookmark->title, $bookmark->url ); ?></h4>
            <small><?= h( $bookmark->url ) ?></small>
            <?= $this->Text->autoParagraph( $bookmark->description ); ?>
        </article>
    <?php } ?>
</section>
Don't Panic
  • 39,820
  • 10
  • 58
  • 75
Momin
  • 2,872
  • 3
  • 29
  • 41

1 Answers1

4

It is the short echo syntax. It is a built-in part of PHP not specific to the CakePHP framework. However, the CakePHP coding standards state that it should be used in template files instead of <?php echo ....

Don't Panic
  • 39,820
  • 10
  • 58
  • 75
Aschab
  • 1,358
  • 1
  • 14
  • 30