Saturday, June 30, 2012

$this->Post = ClassRegistry::init('Post');

Suppose I have the classic Post model and I've created an Author model too.

I have some basic questions:

(1) The Post object is automatically created whithin the PostsController ?

(2) In order to create an instance of Post whithin AuthorsController, is the only way with

$this->Post = ClassRegistry::init('Post');

Please notice that by doing " $this->Post " I assume the Post variable will be created in this line. Am I right ?

Thank you in advance!

--
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: