# |
Oct 22nd 2009, 16:35 |
brookshire |
$this->User->invalidate('username_unique');//populates tagErrorMsg('User/username_unique') |
# |
Oct 22nd 2009, 16:34 |
dogmatic69 |
check the book... you can make /some/long/cake/path == /contact |
# |
Oct 22nd 2009, 16:34 |
brookshire |
i think it's the last example |
# |
Oct 22nd 2009, 16:34 |
dogmatic69 |
meh |
# |
Oct 22nd 2009, 16:34 |
Ceeram |
brookshire: on what line? |
# |
Oct 22nd 2009, 16:34 |
dogmatic69 |
~routing |
# |
Oct 22nd 2009, 16:34 |
brookshire |
not all validation belongs in the model |
# |
Oct 22nd 2009, 16:33 |
sphereweb |
dogmatic69: i am switching frameworks, so i am rewriting my current live website in CakePHP |
# |
Oct 22nd 2009, 16:33 |
dogmatic69 |
sphereweb: that is where routing comes in handy |
# |
Oct 22nd 2009, 16:33 |
brookshire |
The add form view in /app/views/blog/add.thtml |
# |
Oct 22nd 2009, 16:33 |
Ceeram |
brookshire: what its your point? |
# |
Oct 22nd 2009, 16:33 |
brookshire |
in one of their examples, they perform validation in the controller! |
# |
Oct 22nd 2009, 16:33 |
sphereweb |
dogmatic69: Because my website currently has the conatct page as domain.com/Contact/ and if i use /views/contacts/ i would end up with domain.com/ContactS/ |
# |
Oct 22nd 2009, 16:33 |
arz |
Ceeram, so if there is no save method = no validation? |
# |
Oct 22nd 2009, 16:32 |
Ceeram |
you are getting data from kinda datasource |
# |
Oct 22nd 2009, 16:32 |
brookshire |
Ceeram: http://book.cakephp.org/view/318/Data-Validation |
# |
Oct 22nd 2009, 16:32 |
Ceeram |
arz you vallidate data to save in a datasource |
# |
Oct 22nd 2009, 16:32 |
dogmatic69 |
they dont... they make darkness industry standard |
# |
Oct 22nd 2009, 16:32 |
Ceeram |
using 99 developers? |
# |
Oct 22nd 2009, 16:32 |
arz |
Ceeram, ok, just wanted the zen way :-) |
# |
Oct 22nd 2009, 16:31 |
dogmatic69 |
Ceeram: how does m$ change a light bulb? |
# |
Oct 22nd 2009, 16:31 |
Ceeram |
arz just chekc if the data is set then |
# |
Oct 22nd 2009, 16:31 |
dogmatic69 |
brookshire: thats right you can be like m$ if it dont work like it should make a new standard |
# |
Oct 22nd 2009, 16:30 |
arz |
Ceeram, notEmpty , simple ... huh |
# |
Oct 22nd 2009, 16:30 |
Ceeram |
brookshire: give me an example then please |
# |
Oct 22nd 2009, 16:30 |
dogmatic69 |
sphereweb: why you using pages_controller for the form, just put it in views/contacts/ |
# |
Oct 22nd 2009, 16:30 |
Ceeram |
arz: what validation do you need on the incoming dara? |
# |
Oct 22nd 2009, 16:29 |
brookshire |
not all validation belongs in the model |
# |
Oct 22nd 2009, 16:29 |
Ceeram |
you can call validates() from model, or controller or even component but the validation still is in the model |
# |
Oct 22nd 2009, 16:29 |
Ceeram |
brookshire: form a company calling validates()? validates() still is a model method |
# |
Oct 22nd 2009, 16:28 |
sphereweb |
btw i luv CakePHP :) |
# |
Oct 22nd 2009, 16:28 |
arz |
sorry for that question , but does this code look like pure model, or just a set of functions that return output? |
# |
Oct 22nd 2009, 16:28 |
sphereweb |
what could be the problem and how would i attempt to debug it? :) |
# |
Oct 22nd 2009, 16:27 |
sphereweb |
I have a contact view (/views/pages/contact.ctp) where i have an ajax form that is created by $ajax->form(array('type'=>'post','options'=>array('url'=>array('controller'=>'contacts','action'=>'add'),'update'=>'ajaxResponse','indicator' => 'ajaxInd'))); When i submit it, i receive as ajax response the same page (/views/pages/contact.ctp). It seems the request doesnt get to my action URL /contact/add |
# |
Oct 22nd 2009, 16:27 |
dogmatic69 |
brookshire: have you heard of MVC |
# |
Oct 22nd 2009, 16:27 |
brookshire |
but, if you can make it work in the model, that is probably more appropriate |
# |
Oct 22nd 2009, 16:26 |
brookshire |
i think it's perfectly fine to do validation in components using invalidate |
# |
Oct 22nd 2009, 16:25 |
dogmatic69 |
arz: no validation in components |
# |
Oct 22nd 2009, 16:25 |
arz |
Ceeram, well ok, this code produces the output i want, i can move it to be component, create another model, try to validate there ... well i'm lost =( |
# |
Oct 22nd 2009, 16:25 |
dogmatic69 |
ACTION hands Ceeram a beer |
# |
Oct 22nd 2009, 16:24 |
dogmatic69 |
jbcrawford: that normally happens when you explain it properly |