Tuesday, October 4, 2011

Re: CakePHP 2.0 Component Merging

As far as I know, and based on what the tests say, the $components
property is still being merged with AppController/
PluginAppController. Based on a simple test I just did it worked for
me as well.

-Mark

On Oct 3, 12:24 am, Robert <crsh...@gmail.com> wrote:
> Yep, I saw that. I have the Auth component defined in the components
> array of my AppController. My UsersController inherits the
> AppController, so shouldn't the components array from the
> AppController be merged into the components array in the
> UsersController?
>
> On Oct 3, 12:07 am, Andras Kende <and...@kende.com> wrote:
>
>
>
>
>
>
>
> > Try this:http://book.cakephp.org/2.0/en/controllers/components.html
>
> > Andras
>
> > On Oct 2, 2011, at 10:56 PM, Robert wrote:
>
> > > Hey All,
>
> > > Was there a change in the way that components are loaded up in
> > > controllers? I looked at the source and didn't notice anything
> > > different between 1.3 and 2.0 surrounding this.....
>
> > > I pasted my 1.3 source into a 2.0 directory structure and I'm in the
> > > process of re-cake-ifying it....and in my Users controller I have
> > > $this->Auth->allow() being called in beforeFilter. With that, cake
> > > complains "Fatal error: Call to a member function allow() on a non-
> > > object" because the Auth component isn't loaded.
>
> > > However, I have verified that it is loaded in AppController (the
> > > parent controller), shouldn't the two components arrays be merged?
>
> > > This works in 1.3, I literally did a copy and paste of the app code.
>
> > > --
> > > Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 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 athttp://groups.google.com/group/cake-php

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