There should not be any single quotations around the keyword null.
//post.php
class Post extends AppModel{
var $name = 'Post';
var $belongsTo = array(
'User' => array(
'classname' => 'User',
'foreignKey' => 'user_id',
* 'conditions' => null,
'fields' => null
* )
);
}
On Tue, Nov 4, 2008 at 12:51 AM, farfignugin <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I'm new to cake, and I am following tutorial in the book "Apress
> Beginning CakePHP - july 2008." The chapter is explaining
> associations, and I understand but the "belongsTo" side of the
> association breaks and shows a blank screen when I try and run a list
> view of it. Here is the models code:
> \\post.php
> class Post extends AppModel{
> var $name = 'Post';
> var $belongsTo = array(
> 'User' => array(
> 'classname' => 'User',
> 'foreignKey' => 'user_id',
> 'conditions' => 'null',
> 'fields' => 'null'
> )
> );
> }
> //user.php
> class User extends AppModel{
> var $name = 'User';
> var $hasMany = array('Post');
> }
> //posts_controller.php
> class PostsController extends AppController{
> var $name = 'Posts';
> var $scaffold;
> }
> //users_controller.php
> class UsersController extends AppController{
> var $name = 'Users';
> var $scaffold;
> }
>
> I can view a table of users fine (app/users), and I can even add posts
> (app/posts/add). But I can't view the scaffolding of all the posts
> (app/posts). When I try and run that controller, I get an HTML body
> with only a closing pre tag in it (<body></pre></body>). Can anyone
> tell me what I am doing wrong??
>
> Thanks
>
>
>
>
> >
>
Thanks..
--
Anupom Syam
http://syamantics.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---