# |
Oct 22nd 2009, 16:59 |
Ceeram |
what would be the value of $dogmatic? |
# |
Oct 22nd 2009, 16:58 |
Ceeram |
dogmatic69: http://bin.cakephp.org/view/1233067838 |
# |
Oct 22nd 2009, 16:58 |
dogmatic69 |
While normally you would just use the save method of the model, there may be times where you wish to validate the data without saving it. |
# |
Oct 22nd 2009, 16:58 |
dogmatic69 |
the first line of the book says it all |
# |
Oct 22nd 2009, 16:58 |
brookshire |
dogmatic69: i think it depends on the situation |
# |
Oct 22nd 2009, 16:58 |
dogmatic69 |
brookshire: so you want some validation in the controller and some in the model? |
# |
Oct 22nd 2009, 16:57 |
brookshire |
if (!empty($user['User']['username'])) { $this->User->invalidate('username_unique'); } |
# |
Oct 22nd 2009, 16:57 |
brookshire |
like.. |
# |
Oct 22nd 2009, 16:57 |
brookshire |
to put validation rules in the controller |
# |
Oct 22nd 2009, 16:56 |
dogmatic69 |
its there |
# |
Oct 22nd 2009, 16:56 |
dogmatic69 |
arz: check core validation rules |
# |
Oct 22nd 2009, 16:55 |
arz |
or i need to implement it? |
# |
Oct 22nd 2009, 16:55 |
ADmad |
what does manual say is ok ? |
# |
Oct 22nd 2009, 16:55 |
dogmatic69 |
brookshire: next you gonna put $this->Model->validate = array( 'password' ... in beforeFilter |
# |
Oct 22nd 2009, 16:54 |
arz |
or non negative |
# |
Oct 22nd 2009, 16:53 |
arz |
ok, one more question, is there a validation rule like abow zero? |
# |
Oct 22nd 2009, 16:52 |
brookshire |
dogmatic69: the manual says it's okay, so it's okay.. deal withit |
# |
Oct 22nd 2009, 16:52 |
dogmatic69 |
someone with some mad skills should speak to this brookshire |
# |
Oct 22nd 2009, 16:52 |
arz |
need to stomach all info |
# |
Oct 22nd 2009, 16:51 |
brookshire |
you still initiate the validation process form the controller |
# |
Oct 22nd 2009, 16:51 |
dogmatic69 |
brookshire: php has method_exists() but no process_exits() :P |
# |
Oct 22nd 2009, 16:50 |
Ceeram |
validation itself is a proces indeed but should reside within model |
# |
Oct 22nd 2009, 16:50 |
brookshire |
validate and invalidate or methods |
# |
Oct 22nd 2009, 16:50 |
dogmatic69 |
its a method |
# |
Oct 22nd 2009, 16:49 |
brookshire |
Ceeram: all i said was do the validation in the controller... the logic.. validation is a process to me, not a method |
# |
Oct 22nd 2009, 16:49 |
Ceeram |
so we do agree |
# |
Oct 22nd 2009, 16:49 |
Ceeram |
in the model? |
# |
Oct 22nd 2009, 16:49 |
Ceeram |
is there brookshire really? |
# |
Oct 22nd 2009, 16:48 |
brookshire |
yes there is :) |
# |
Oct 22nd 2009, 16:48 |
arz |
brookshire, there is no such function in model |
# |
Oct 22nd 2009, 16:47 |
Ceeram |
yessss |
# |
Oct 22nd 2009, 16:47 |
dogmatic69 |
ACTION spelling may be questioned |
# |
Oct 22nd 2009, 16:47 |
dogmatic69 |
Ceeram: are you questioning me again |
# |
Oct 22nd 2009, 16:47 |
Ceeram |
dogmatic69: yeahyeah |
# |
Oct 22nd 2009, 16:47 |
arz |
dogmatic69, sure |
# |
Oct 22nd 2009, 16:47 |
dogmatic69 |
P |
# |
Oct 22nd 2009, 16:47 |
brookshire |
arz: validate in the controller... use invalidate to throw form errors |
# |
Oct 22nd 2009, 16:47 |
dogmatic69 |
Ceeram: in a controller: |
# |
Oct 22nd 2009, 16:47 |
Ceeram |
oh damn dogmatic69 yes you are right |
# |
Oct 22nd 2009, 16:47 |
FMC |
dogmatic69: then how to set the field to be required and notempty at add, but not at edit ? |
# |
Oct 22nd 2009, 16:47 |
brookshire |
or |