Neat Functions in CakePHP


If ever you want to remove a validation temporarily for certain fields

you can use unset before saving the data

unset($model->validates[‘fieldname’]);

I also learned also another function to know what field validation I

violated especially when your updating your records because sometimes

it does not show the validation errors I use debug to display it

if(!$this->save())

{

debug($this->validationErrors);

die();

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: