how do I access another helper (e.g. FormHelper) from with a new helper method I've built?
class AppHelper extends Helper {
public function generateSpecialInput() {
return $this->Form->input('I\'m special')
}
}
In the above example, Form is the helper I want to use from within my AppHelper::generateSpecialInput method. Should I be passing the FormHelper object into the method, or is there a better way to do it?
see http://book.cakephp.org/2.0/en/views/helpers.html#including-other-helpers
class AppHelper extends Helper {
public $helpers = array('Form');
public function generateSpecialInput() {
return $this->Form->input('I\'m special');
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With