Friday, May 14, 2010

Re: Calling controller from view Vs using define

What kind of data are you passing?

Just place this in your AppControllers::beforeFender();

$this->set('var', $this->myFunc());

On May 14, 4:56 am, Mandy Singh <man...@gmail.com> wrote:
> Hi Everyone,
>
> Quick question:
>
> I need to get something in the view (all views) for which I have a
> function defined in the app_controller.
>
> So, what I want to know is what is more efficient?
>
> 1. Calling $this->controller->myFun() from the view (of course it
> beats the MVC model)
>
> 2. Using define() and setting it as a constant through
> app_controller ?
>
> I read that define() is an expensive call. I am not killing my self
> over over-optimization but thought it would be nice to know if
> define() is an expensive call.
>
> Thanks,
> Mandy
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> 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?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate