Wednesday, December 30, 2009

Re: Getting incremental number from the counter

The generated number is always 1. Does that mean that everytime I hit this
controller action (processForm), a new Post model is created and static num
variable is always set to null ?

Yes
 
If that is so, how can I make a method that increment number in a model ??

Store it on a persistent storage like the database, then retrieve it and update accordingly. 

Regards,

Pablo Viojo
pviojo@gmail.com
http://pviojo.net

¿Que necesitas?
http://needish.com

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: