Cakephp国家助手
我与此助手有问题: 此帮助程序给了我此错误,但我找不到原因:Cakephp国家助手,cakephp,formhelper,Cakephp,Formhelper,我与此助手有问题: 此帮助程序给了我此错误,但我找不到原因: Fatal Error Error: Call to a member function input() on a non-object File: \app\View\Helper\LangHelper.php Line: 670 您是否在AppController中激活了FormHelper App::uses('FormHelper', 'View/Helper'); // Don't forget this one in
Fatal Error
Error: Call to a member function input() on a non-object
File: \app\View\Helper\LangHelper.php
Line: 670
您是否在
AppController
中激活了FormHelper
App::uses('FormHelper', 'View/Helper'); // Don't forget this one in Cake 2.x
class AppController extends Controller
{
public
$helpers = array('Form');
}
您是否在
AppController
中激活了FormHelper
App::uses('FormHelper', 'View/Helper'); // Don't forget this one in Cake 2.x
class AppController extends Controller
{
public
$helpers = array('Form');
}
我猜问题在于LangHelper重写了父级
\uu构造
方法,阻止了Cake正确设置助手。将LangHelper的\u构造()
更改为以下内容:
public function __construct(View $View, $settings = array()) {
parent::__construct($View, $settings);
$this->mapper = $this->parseLangHeaders();
$this->langCode = $this->findLangCode();
$this->countryCode = $this->findCountryCode();
}
我猜问题在于LangHelper重写了父级
\uu构造
方法,阻止了Cake正确设置助手。将LangHelper的\u构造()
更改为以下内容:
public function __construct(View $View, $settings = array()) {
parent::__construct($View, $settings);
$this->mapper = $this->parseLangHeaders();
$this->langCode = $this->findLangCode();
$this->countryCode = $this->findCountryCode();
}
那个插件已经一年多了-你用的是什么版本的蛋糕?看起来像是一个依赖性问题那个插件已经一年多了-你用的是什么版本的蛋糕?看起来像是一个依赖性问题非常感谢Ben,现在没事了;)非常感谢你,本,现在没事了