如何以 ZF2 方式即时执行 ZF1 中显示的以下 __construct 部分?
我已经尝试$this->headTitle('..');
通过省略 ->view 调用,但它仍然通过抛出失败:
Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for headTitle
public function __construct() { //init is gone
$this->_helper->layout()->setLayout('brand');
$this->HeadTitle($this->title)->setIndent(8);
$this->view->headMeta()->appendName('keywords', $this->keyword)->setIndent(8);
$this->view->headMeta()->appendName('description', $this->description)->setIndent(8);
$this->view->headMeta()->appendName('Language', 'en')->setIndent(8);
$this->view->headMeta()->appendName('dc.title', $this->title)->setIndent(8);
$this->view->headMeta()->appendName('dc.keywords', $this->keyword)->setIndent(8);
$this->view->headMeta()->appendName('dc.description', $this->description)->setIndent(8);
$this->view->headLink()->appendStylesheet('/css/main.css')->setIndent(8);
$this->view->headLink()->appendStylesheet('/jquery/css/custom-theme/jquery-ui-
1.8.20.custom.css')->setIndent(8);
$post = $this->getRequest()->getPost();
$get = $this->getRequest()->getQuery();
}