我对这个助手有疑问: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
我对这个助手有疑问: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
我猜问题是 LangHelper 覆盖了父__construct
方法,阻止了 Cake 正确设置 Helper。将 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();
}
你在里面激活FormHelper
了AppController
吗?
App::uses('FormHelper', 'View/Helper'); // Don't forget this one in Cake 2.x
class AppController extends Controller
{
public
$helpers = array('Form');
}