我对这个帮助器有一个问题:https://github.com/kshakirov/cakephp-lang-helper
这个帮助器给了我这个错误,我找不到原因:
Fatal Error
Error: Call to a member function input() on a non-object
File: \app\View\Helper\LangHelper.php
Line: 670发布于 2012-11-08 09:51:54
我猜问题在于LangHelper重写了父__construct方法,使其无法正确设置帮助器。将LangHelper的__construct()更改为:
public function __construct(View $View, $settings = array()) {
parent::__construct($View, $settings);
$this->mapper = $this->parseLangHeaders();
$this->langCode = $this->findLangCode();
$this->countryCode = $this->findCountryCode();
}发布于 2012-11-08 07:35:58
您是否在AppController中激活了FormHelper
App::uses('FormHelper', 'View/Helper'); // Don't forget this one in Cake 2.x
class AppController extends Controller
{
public
$helpers = array('Form');
}https://stackoverflow.com/questions/13279438
复制相似问题