I am trying to use Form helper in Controller. I need it because I need to store the form HTML in another file. My code in controller is as follows:
<?php
function html_form($id){
$form_fields=array();//has many values
$html .= $this->Form->create('web_forms', array(
'action' => 'html_form
));
$html .= $this->Form->input($form_fields['name']);
return $html;
?>
When I called this function, it throws an error as follows.
Fatal error: Call to a member function create() on a non-object in ****
How to use Form helper in controller??