Re: Simple String Manipulations?

2009-01-10 Thread Bernardo Vieira
Best place to handle this is in your model's beforeSave() callback: http://book.cakephp.org/view/683/beforeSave ingenious paradox wrote: > I'm very new to cake and I was hoping someone could demonstrate the > code necessary to take a form field input value and convert it to > uppercase. I know th

Re: Simple String Manipulations?

2009-01-10 Thread Adam Royle
Try this in your model... class Whatever extends AppModel { function beforeSave() { $data = &$this->data[$this->alias]; if (!empty($data['title'])) { $data['title'] = ucwords($data['title']); } return parent::beforeSave(); } } Your could then m

Simple String Manipulations?

2009-01-10 Thread ingenious paradox
I'm very new to cake and I was hoping someone could demonstrate the code necessary to take a form field input value and convert it to uppercase. I know this is simple with the ucwords() function, but for some reason I just can't get it to work properly. I read that you have to perform your own met