Override behavior method?

2012-06-28 Thread Poyan Nabati
From the manual: Behavior methods are automatically available on any model acting as the behavior. For example if you had: ?php class Duck extends AppModel { public $name = 'Duck'; public $actsAs = array('Flying'); } You would be able to call FlyingBehavior methods as if they were

Re: Override behavior method?

2012-06-28 Thread Poyan Nabati
Excellent. Thank you. -- 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

Routes vs Type checking for Action Parameters, best practice?

2012-06-28 Thread Poyan Nabati
Lets say I have a controller Books with an action view() defined as follows: class BooksController extends AppController { public function view($id) { // something } } Let's assume that $id is supposed to be of a numeric type. I see two options; 1) Setup the route so that it only

Re: Routes vs Type checking for Action Parameters, best practice?

2012-06-28 Thread Poyan Nabati
That's another type of error though. It's something have to handle in your application but I don't see the relation to my OP. -- 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

Re: Routes vs Type checking for Action Parameters, best practice?

2012-06-28 Thread Poyan Nabati
I think you're not using routes in their purest form (to route stuff in the right way - rather than error trapping. Thing is, if you haven't supplied an integer, then there's really no matching action for the URL you've requested. I think that's completely in line with the purpose of routes.

Re: Slightly different models, merge or separate?

2012-06-26 Thread Poyan Nabati
Anyone? On Monday, June 25, 2012 10:12:43 AM UTC+2, Poyan Nabati wrote: I have a question regarding more the design of the back-end rather than specifically how to implement it. I'm creating a life tracker of sorts. The purpose is to have a single application to help you keep track

Re: Advice about design.

2012-06-26 Thread Poyan Nabati
I feel like this is a good match for ACLhttp://book.cakephp.org/2.0/en/core-libraries/components/access-control-lists.html, you should check it out! On Tuesday, June 26, 2012 7:44:45 PM UTC+2, Janne Johansson wrote: Hello! I am pretty much a complete newbie in regards to Cake, so I am

Slightly different models, merge or separate?

2012-06-25 Thread Poyan Nabati
I have a question regarding more the design of the back-end rather than specifically how to implement it. I'm creating a life tracker of sorts. The purpose is to have a single application to help you keep track of things that are important to you long term. I want to be able to track a

Including an element many times in a page

2012-06-25 Thread Poyan Nabati
This question is more about code design / code smell than a practical solution. I have a page where I list some tabular data. *Is it poor design to store the presentation of a single row in an element, and then for each row in that table display that element, passing different data to it