Friday, November 4, 2011

Re: How to get related username in view?

Can you paste all your model code from the top until the end of this code. Looks like you're pasting outside of a function.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 4 Nov 2011, at 17:08, Daniel wrote:



On Nov 4, 4:49 pm, Jeremy Burns | Class Outfit
<jeremybu...@classoutfit.com> wrote:
This code would go into the Category model.

$categories = $this->find(
'all',
array(
'conditions' => array('Category.category_id' => $id),
'Contain' => array(
'Post' => array(
'User' => array(
'User.id',
'User.name'
)
)
)
)
);

I tried putting this in the categories model and I got an error on the
first line:
Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs
\blogtest\models\category.php on line 42

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: