Wednesday, December 15, 2010

Re: Prefix routing and different user types

As an addition regarding the definition of constants to replace my
magic numbers.

The accountype model stores an id and name, e.g. 3 - admin. So is
there a way I can either use this to define my constants, or some
better cake way of doing this?

Didn't want to get to far into this bit, as my real issue at the
moment is still the account / routing thing.

On Dec 15, 10:09 am, chris <chris....@internetlogistics.com> wrote:
> I'm planning on replacing these with a constant at some point. Is
> there a cake way of defining things like this?
>
> Are there any other issues with the cake side of things in my code?
>
> On Dec 14, 9:30 pm, Ryan Schmidt <google-2...@ryandesign.com> wrote:
>
> > On Dec 14, 2010, at 08:45, chris wrote:
>
> > > if($this->Auth->User('accounttype_id')==3)
>
> > Using magic numbers (here, 3) is probably a bad idea.
>
> >http://en.wikipedia.org/wiki/Magic_number_(programming)#Unnamed_numer...

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