0

I'm using CakePHP.

Today I tried to link a page of the Page Controller to another page from the Page controller, and I couldn't get to see the link until I wrote

<?= $this->Html->link('myPage', array('controller' => 'pages', 'action' =>
    'myPage')); ?>

Why did I have to write <?= and not <?php ?

Generally speaking, when do I have to use <?= and when <?php ?

Vereos
  • 503
  • 4
  • 15
  • Doing some proper researches now that I know the answer, I found out that this is just a duplicate of a lot of other similar questions. Should I delete this question? – Vereos Dec 19 '13 at 16:35

1 Answers1

4

<?= is short for <?php echo

Add echo to your code and it will work.

This is not unique to CakePHP, it's just part of PHP.

Jessica
  • 7,075
  • 28
  • 39
  • I guess it's me being really noob then! I'll edit post title and remove CakePHP tag. Thank you! – Vereos Dec 19 '13 at 16:32