Tuesday, December 29, 2009

Re: Cookie in Models

Couldn't you just use app_model.php to make the data available to all
your models?

On Dec 28, 2:18 am, dyutiman <dyutiman.chaudh...@gmail.com> wrote:
> Hi Nabil,
> thanks for your reply and suggestion. It'll really help.
> I thought about getting the cookie value in controller and pass it to
> model. But for this I have to rewrite every model functionality
> provided by cake by default.
> I am still thinking of a good solution of the problem. But in the mean
> time the cookie method will work for us.
>
> thanks
> Dyutiman
>
> On Dec 24, 9:53 pm, Nabil Alsharif <bli...@gmail.com> wrote:
>
> > Pulling the client_id from thecookiein themodelreally isn't a good
> > idea IMO. The only way I can think of doing it is straight up with php's
> > basiccookiefunctions or doing something like
> > ClassRegistry::init('CookieComponent') and hoping it doesn't bomb out on
> > you.
>
> > OTOH you can easily get to the cookies in the controller and pass it in
> > to yourmodelwhen it's needed.
>
> > On Thu, 2009-12-24 at 07:59 -0800, dyutiman wrote:
>
> > > Hi,
>
> > > I am building an application with multiple database. Database gets
> > > selected based upon clients. Now the client_id is saved in acookie. I
> > > have to read thecookievalue in my /app/app_model.php page to select
> > > respective database.
>
> > > Is there a way to retrieve thecookievalue in that page !!!
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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

No comments: