I did read it, but did not maybe digest it fully. Just trying to keep
working away on the project, which is allready fairly far down my
current way of working things.

I see that using the routing names would allow me to not have to do
checks the account type id's. However, at the moment the application
does not work in this way for all user account types.

I.e. there is admin/ routing, and then one other user type with
routing. However, there is also a lower user level, where they do not
have pre-fixes for their actions.

Hopefully I have understood it properly, but maybe not. But given that
its not possible for me to just use the prefix routing check, is there
a good way of getting rid of my magic numbers. Usually I would just
define them as standard PHP constants.

Thanks for your time.

On Dec 15, 11:22 am, "Dave Maharaj" <[email protected]> wrote:
> I guess you never read what I wrote?
>
> -----Original Message-----
> From: chris [mailto:[email protected]]
> Sent: December-15-10 6:39 AM
> To: CakePHP
> Subject: Re: Prefix routing and different user types
>
> 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 <[email protected]> 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 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 [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