When attempting to bake views, I consistently get stopped with syntax errors as follows:
Parse error: syntax error, unexpected '$this' (T_VARIABLE), expecting identifier (T_STRING) in /vagrant/lib/Cake/Console/Templates/default/views/index.ctp on line 27
The context for the code causing the error here doesn't seem problematic to me.
<?
foreach ($fields as $field):
if (!in_array($field, array('created', 'body', 'description', 'position', 'slug'))) {
echo "\t\t<th><?php echo $this->Paginator->sort('{$field}'); ?></th>\n";
}
endforeach;
?>
It seems to have problems because it is trying to interpret the code it should generate in the string as code it should run, and thus thinks the string '$this->Paginator->sort(...)' is an object variable calling a function, and so on.
I am running PHP 5.3.37-1 on Ubuntu Trusty x64 on a Vagrant box.