Re: Where should I insert this before filter? AppController or AppModel?
On Thu, Mar 24, 2011 at 7:21 PM, euromark <dereuromark@googlemail.com> wrote:
> because you just importet the class..
>
> use
>
> $this->Season = ClassRegistry::init('Season')
>
> or loadModel('Season')
Oops! Yes, my bad. I meant the first choice. App::import() is not a
good choice here.
if ((is_null($id)) || (!is_numeric($id)))
{
$this->Session->write(
'editable_season_id',
ClassRegistry::init('Season')->getLastSeasonId()
);
}
Sorry about that.
--
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
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home