sergserg
sergserg

Reputation: 22264

PHP tags aren't recognized when placed like '<?'

I have a simple CakePHP application and in my Views, I dynamically set the title for each view:

<? $this->viewVars['title_for_layout'] = 'Wicked Awesome Title' ?>

However on one of my machines, the code is not run but instead outputted to the browser windows as if it weren't recognized PHP code.

<!-- Actual output in the browser window. -->    
viewVars['title_for_layout'] = 'Wicked Awesome Title' ?>

If I place the proper <?php tag, everything runs fine, but that is not the default way CakePHP recommends.

Why does it work on one machine, but not in the other?

Upvotes: 0

Views: 61

Answers (1)

nickb
nickb

Reputation: 59699

One of your machines does not have short_open_tags enabled in its configuration.

Upvotes: 5

Related Questions