0

I'm new in cakephp, but I must resume an cakephp project, and after copy to my server, the pages are rendered with <?= in my html source code. After I looked the files, I find <?= marks in ctp files, like this: <?= $this->element("header") ?>

What configuration is wrong, when this part of code I see in my html source code?

Thanks for help.

Dopicsi
  • 33
  • 6

1 Answers1

1

That's actually a feature of PHP, known as short tags, see http://php.net/manual/en/language.basic-syntax.phptags.php

Where <? is short for <?php, and <?= is short for <?php echo

Short tags are not widely used primarily because not all servers support them. There are other various arguments and opinions over whether short tags are okay to use or not, as seen in Are PHP short tags acceptable to use?

As seen in: How to enable PHP short tags?

Set

short_open_tag=On in php.ini

And restart your Apache server.

Community
  • 1
  • 1
Kai
  • 3,803
  • 1
  • 16
  • 33