Obviously, component is for controllers, helper is for views. The
reason for the helper is that often view output depends on what is in
the session, and it can get a little tedious set()'ing everything from
the session out for the view, in the app_controller beforeFilter
("just in case" the view needs it for this request).
You will notice that the session helper is read only - you cannot
write from the view. So while it may be a little against the grain of
MVC, it is also very handy :)
On Nov 20, 8:01 pm, avairet <[EMAIL PROTECTED]> wrote:
> Hi everybody,
>
> I'm relatively newbie with Cake 1.2 and I don't understand very well
> the difference between Session Helper and Session Component, which
> have some common methods.
> Is this againsts the 'DRY' (don't repeat yourself) rule?
> Why using "write" and "read" Session method in a view? This is
> normally controller's job, isn't it?
> Can you explain the difference or show me an example of Session usage
> with component and helper?
> Thank's by advance and excuse me for my simple English.
>
> BR
>
> Avairet
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---