tags:

views:

20

answers:

2

I'm getting Parse error: syntax error, unexpected T_STRING while i cake bake model because the model generated has single quotes not closed like '

Photo' => array(
            'className' => 'Photo',
            'foreignKey' => 'album_id',
            'dependent' => false,
            'conditions' => ',
            'fields' => ',
            'order' => ',
            'limit' => ',
            'offset' => ',
            'exclusive' => ',
            'finderQuery' => ',
            'counterQuery' => '

how do i fix this ?

A: 

It looks to me like your problem starts up near the generation of the Photo model. Is it possible that you accidentally typed in the model name as Photo', rather than Photo?

To fix, simply correctly pair up the single quote marks. Delete the mark after photo, then change the others so they pair up in syntactically correct semantics.

There really is nothing too special about the baked methods. They can help auto generate some stuff at the start of a project, but after that, feel free to modify them as necessary.

Travis Leleu
A: 

http://bakery.cakephp.org/articles/view/custom-baking-with-cakephp-1-3

As an extension to Travis's answer, you can also create your own bake templates, this makes it very easy to save on a lot of modifying the default templates, which, IMO are crap.

rich97