# |
Oct 22nd 2009, 17:03 |
dogmatic69 |
brookshire: if you want to know how to validate from a model look at the core |
# |
Oct 22nd 2009, 17:03 |
brookshire |
so far the only answers i have seen, were along the lines of "it's too much explain over MIRC" |
# |
Oct 22nd 2009, 17:02 |
arz |
'( |
# |
Oct 22nd 2009, 17:02 |
ADmad |
Ceeram: i think i got the gist of it so not gonna bother |
# |
Oct 22nd 2009, 17:02 |
brookshire |
arz: i don't think they can tell you how to do what you wanting to do for the model |
# |
Oct 22nd 2009, 17:02 |
Ceeram |
ADmad: read back about validation discussion |
# |
Oct 22nd 2009, 17:01 |
dogmatic69 |
brookshire: you dont validat a form you validat the data from a form DUH |
# |
Oct 22nd 2009, 17:01 |
dogmatic69 |
ye |
# |
Oct 22nd 2009, 17:01 |
dogmatic69 |
that is not return is it |
# |
Oct 22nd 2009, 17:01 |
Ceeram |
so should you dogmatic69 |
# |
Oct 22nd 2009, 17:01 |
brookshire |
dogmatic69: he's wanting to validate a form, not the data, duh |
# |
Oct 22nd 2009, 17:01 |
Ceeram |
im off to bed |
# |
Oct 22nd 2009, 17:00 |
Ceeram |
thats what i meant with just return |
# |
Oct 22nd 2009, 17:00 |
Ceeram |
arz: you might wanna look at the bin i just posted as well |
# |
Oct 22nd 2009, 17:00 |
dogmatic69 |
arz: on? |
# |
Oct 22nd 2009, 17:00 |
arz |
dogmatic69, comparison? |
# |
Oct 22nd 2009, 16:59 |
dogmatic69 |
* |
# |
Oct 22nd 2009, 16:59 |
Ceeram |
) |
# |
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 |