since when are constants NOT global?

if you define them in your model (above the class statement)
just refer to them like you usually would

echo USER_ROLE_READER etc

thats all there is to it


On 25 Aug., 12:53, pph7 <kessler.m...@gmail.com> wrote:
> Hi there!
> I am looking for a way to define custom constants in models. I realize
> it is possible to define global constants in bootstrap.php and this
> works well but for example, when I want to define user roles for
> different acces rights like
>
> define("USER_ROLE_READER", 1);
> define("USER_ROLE_PUBLISHER", 2);
>
> The logical way for me would to do that in the User model so I can
> access these constant with
>
> User::USER_ROLE_READER
>
> etc.
>
> Is there a way to do this or do you disagree with my approach?
>
> thx!
> mark
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to