Ernesto,
I'm not sure what you are trying to do exactly. But I am curious
about feedback on this method; I have used to override the default
behavior of the formHelper in the past. I know there are other ways
to provide the functionality that's in this example.
I would provide my own class, myFormHelper in this example.
<?php
App::import('Helper','Form');
class MyFormHelper extends FormHelper {
public $default_options=array('label'=>false,'div'=>false));
public function input($fieldname,$options=array()){
return parent::input($fieldname,am($options,$this-
>default_options));
}
?>
Now, there are two ways I use classes like this. When I'm working on
a new project, I just add 'MyForm' to the helpers list in my
controllers, and use $myForm->input() in my views. For an existing
project, I take a different route. For an existing project, I don't
want to go through all the views and update them to use the new
helper, so I make mine available with the old name.
<?php // Some controller
public $helpers=array('Html','MyForm');
public function beforeRender(){
$this->Form =& $this->MyForm;
}
?>
Ernesto, would this fit your goals?
-teh
On May 11, 3:26 am, Ernesto <[email protected]> wrote:
> Hello.
>
> is there any way to change FormHelper and HtmlHelper default settings??
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---