Thanks for your reply, Nick. Nice to see a familiar face here, too :) I could swear the last time I looked through the Book, it wasn't there. But now it is. I solved it with this bit of widom from the 1.3 section:
http://book.cakephp.org/view/1616/x1-3-improvements Although I would have liked to set these options in the AppController, and have it filter through site-wide, I suppose once per form ain't so bad. ********* On Jul 10, 7:38 am, nurvzy <[email protected]> wrote: > As far as I know you can't set the default input options at the > constructor level. Although I haven't dug into the code in a while to > make sure of that. If I'm wrong, someone will correct me. > > You can go the MyFormHelper class route, which may be the *best* > option IMHO. Just overwrite the create function calling the > parent::create() with a set an array_merge of default options you > want. > > class MyFormHelper extends FormHelper { > var $defaults = array('inputDefaults' => array('div' => false)); > > function create($model = null, $options = array()){ > parent::create($model, array_merge($this->defaults, $options)); > } > > } > > Simple as that. > > Or you can instead use an element, pass in an array as options to > array_merge with your default options for your form. That is a trick > I like to use often with pagination options and links. > > Another option, could be defining a $default_form_options in your > app_controller than you set and use for every form create (adjusting > as needed). > > Example: > //app_controller beforeFilter > $this->set('default_form_options', array('inputDefaults' => > array('div' => false))); > > //view > $this->Form->create('Model', array_merge($default_form_options, > array('url' => 'some_where'))); > > You get the idea... > > Hope that helps, > Nick Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
