-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
  • 41,125
  • 10
  • 61
  • 80
Momin
  • 3,200
  • 3
  • 30
  • 48

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
  • 41,125
  • 10
  • 61
  • 80
Aschab
  • 1,378
  • 2
  • 14
  • 31