@milesJ

I guess my point would be that you don't need that overhead of setting
that extra var in every circumstance, so it may just be better to call
Configure:: from the view.  And just so I understand, what would be
the difference between business logic and templating logic? Are you
saying that views should only have stuff in them relating to the
layout? I have been using a broader definition where anything
localized to that action goes in the view, such as looping through set
data, extracting things from variables etc. Anything like grabbing
records or handshaking  would be in the controller, but does
Configure:: really qualify as something that should never go in a
view? If you needed to read the config on every page I would put in
into AppController::beforeFilter as you suggested, but for a one shot
deal I would just call from the view statically.

On Sep 15, 9:55 pm, Miles J <[email protected]> wrote:
> View is for templating logic, not for business logic. It should be
> passed down from the controller.
>
> I usually just do this in my beforeFilter().
>
> $this->set('config', Configure::read('foo'));
>
> On Sep 15, 2:06 pm, "j.blotus" <[email protected]> wrote:
>
>
>
> > @Jeremy
> > I would have to disagree about skinny views, because putting stuff in
> > the views should help keep clutter out of the controller, which I
> > think should be as thin as possible. I think it's a bit inefficient to
> > set a variable in the controller that you could just read statically
> > in the view, such as Configure::read().
>
> > On Sep 15, 4:51 pm, Jeremy Burns | Class Outfit
>
> > <[email protected]> wrote:
> > > This is just a wild guess, but I would think that doing it the controller 
> > > is more efficient than doing it the view? The view is supposed to be as 
> > > skinny as possible and only contain layout and flow type logic, rather 
> > > than application control.
>
> > > Jeremy Burns
> > > Class Outfit
>
> > > [email protected]http://www.classoutfit.com
>
> > > On 15 Sep 2010, at 21:12, Tilen Majerle wrote:
>
> > > > "Do it in the controller action and pass it down as a 
> > > > variable."....that's second option
> > > > --
> > > > Tilen Majerle
> > > >http://majerle.eu
>
> > > > 2010/9/15 Jeremy Burns | Class Outfit <[email protected]>
> > > > Do it in the controller action and pass it down as a variable.
>
> > > > Jeremy Burns
> > > > Class Outfit
>
> > > > [email protected]
> > > >http://www.classoutfit.com
>
> > > > On 15 Sep 2010, at 21:06, xtraorange wrote:
>
> > > > > Howdy folks,
>
> > > > > I'm trying to access a value via the read method of Configure in my
> > > > > layout, but I can't figure out how to do it.
>
> > > > > How do I read a configuration value in the layout?
>
> > > > > Thanks,
> > > > > James
>
> > > > > Check out the new CakePHP Questions 
> > > > > sitehttp://cakeqs.organdhelpothers 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 [email protected]
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected] For more options, visit this 
> > > > > group athttp://groups.google.com/group/cake-php?hl=en
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
> > > > 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 [email protected]
> > > > To unsubscribe from this group, send email to
> > > > [email protected] For more options, visit this 
> > > > group athttp://groups.google.com/group/cake-php?hl=en
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
> > > > 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 [email protected]
> > > > To unsubscribe from this group, send email to
> > > > [email protected] 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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to