Re: possible to do validation in not current model? where should I put validation??

2009-08-11 Thread leafchild
Thanks brian, now I can put my validation code at model. On Aug 7, 6:26 pm, brian bally.z...@gmail.com wrote: I'm not sure that I understand your question. But you can call the model's function directly from the controller. On Fri, Aug 7, 2009 at 4:42 PM,leafchildleafchild.b...@gmail.com

Re: possible to do validation in not current model? where should I put validation??

2009-08-07 Thread leafchild
Thanks, brian. but can I associate with my validation macadamized function? so if set validation in Size model: = ... 'size_name' = array( 'namechk'=array(

Re: possible to do validation in not current model? where should I put validation??

2009-08-07 Thread brian
I'm not sure that I understand your question. But you can call the model's function directly from the controller. On Fri, Aug 7, 2009 at 4:42 PM, leafchildleafchild.b...@gmail.com wrote: Thanks, brian. but can I associate with my validation macadamized function? so if set validation in Size

Re: possible to do validation in not current model? where should I put validation??

2009-08-04 Thread brian
Create some method in the Size model and pass the category_id to it: if ($this-Product-Size-yourMethod($category_id)) On Mon, Aug 3, 2009 at 3:45 PM, leafchildleafchild.b...@gmail.com wrote: thanks brian. Is possible to pass specific value to validation at model(Size model in this case)

Re: possible to do validation in not current model? where should I put validation??

2009-08-03 Thread leafchild
thanks brian. Is possible to pass specific value to validation at model(Size model in this case) I want to create custom validation but I need to pass value to do it. (in this case, category_id) thanks, leafchild On Aug 2, 8:49 am, brian bally.z...@gmail.com wrote: Try this:

Re: possible to do validation in not current model? where should I put validation??

2009-08-02 Thread brian
Try this: $this-Product-Size-set($this-data); if ($this-Product-Size-validates()) { ... On Fri, Jul 31, 2009 at 3:12 PM, leafchildleafchild.b...@gmail.com wrote: For example There are 3 tables categories, products and sizes, and I'm working on product page (product.php,

possible to do validation in not current model? where should I put validation??

2009-07-31 Thread leafchild
For example There are 3 tables categories, products and sizes, and I'm working on product page (product.php, products_controller.php, product.ctp). The database looks like this. sizes: --- |id | --- | category_id | | size_name|