CakePHP - extending FormHelper causes error in it

98 Views Asked by At

I want to extend the FormHelper and used this part of a method's code to be called in the view.

$out = parent::input($fieldName, $opts);
return parent::output($out);

Error: Call to a member function useTag() on a non-object File: ...lib/Cake/View/Helper/FormHelper.php Line: 861

The label method :

return $this->Html->useTag('label', $labelFor, $options, $text);

CakePHP version 2.5.1

1

There are 1 best solutions below

0
On

I had the same issue, and I finally figured out the answer.

Make sure you are including the HtmlHelper in yours.

public $helpers = array('Html');

Thanks to Holt59's "CakePHP 2.x Helpers for Bootstrap 3" code, where I found the answer.