That's exactly what I ended up doing actually :)

On 9/13/06, John Zimmerman <[EMAIL PROTECTED]> wrote:
> Depending on your situation it might make sense to make the variable in
> question a class variable of your controller.
>
> Your reusable methods could then check and set the variable as necessary.
> Then before your view is rendered (either before you action returns or in a
> beforeRender method) you would use the $this->set() method to transfer that
> class variable to the view.
>
> This way you can output debug info all you want and you wouldn't be
> modifiying the _viewVars array in your controller directly.
>
>
> On 9/11/06, Bert Van den Brande <[EMAIL PROTECTED]> wrote:
> >
> > Ok tnx for the explanation :)
> >
> > Reason I searched for that function was that I had split some
> > controller logic into a couple of reusable methods, and at a certain
> > point I needed to now the decision of method X inside method Y.
> >
> > Of course there were plenty other solutions, but looking for a way to
> > retrieve the var I had set in method X was my first intention ...
> >
> > On 9/11/06, nate <[EMAIL PROTECTED]> wrote:
> > >
> > > Controller::_viewVars is treated as a protected object property.
> > > Accessing proctected properties within a class or child of the class is
> > > perfectly legal, and I'm not a big fan of adding extra pointless
> > > getters and setters.  The only reason there's a set( ) method for it is
> > > because it provides actual value over and above simply assigning
> > > key/value pairs to an associative array.
> > >
> > >
> > > >
> > >
> >
> >
> > > >
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to