would be loaded every time (even if the model is not needed at all).
but even there it does not hurt.
the main reason why this SHOULD be in the model (and as class
constants) is that it belongs to it
and you can address it with Model::CONSTANT in your code which
improves readability (using integers directly is a bad coding habit).
defined at the very bottom of a model this does not hurt - in my
opinion
and thats where I put them :)
On 25 Jan., 20:57, Stephen <step...@ninjacodermonkey.co.uk> wrote:
> I've decided to use your method euromark, it seems pretty well thought out,
> I must admit the only pet peeve I have with this is having to define the
> constants in my model.
>
> I'm talking about 20 protential "enum" fields.
> Having 20 sets of *const FIELD_VALUE = 0; *etc, it could create many lines
> in my model.
>
> This seems a little icky to me, but the rest of it is great.
>
> Perhaps this is better defined in 1 global place like bootstrap where during
> an average day developing you're unlikely to see it ?
>
> Just a thought
>
> Kind Regards
> Stephen
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
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
No comments:
Post a Comment