So my problem is that i know how to load an Helper into the Controller but it´s only working for HtmlHelper not for FormHelper.
i load it into my method like this:
//this method is from an controller like page_controller
function addField($pageID) {
if($this->RequestHandler->isAjax()) {
$this->autoRender = false;
}
App::import('Helper', 'Form');
$form = new FormHelper();
return $form->input('test');
}
I got some error like can´t load on unknown stdClas::$model etc.
HtmlHelper works well when i ouput it with link method i got a full rendered link in my view.
I wont only to load on Ajax an new input but it won´t work and i do not know why... Hope you understand my problem.
what you are doing there is awfully wrong. there is good reason why this doesn't and should never work your way.
use the normal MVC procedure as outlined in the documentation and tutorials. http://book.cakephp.org/
in your case this means that you NEED to always use a view template (/views/controllername/actionname.ctp) and put your form stuff in there.