1
我有Action Helper是數據庫抽象層。如何在視圖助手中作爲代理方法調用Action Helper?
我想在View Helper中訪問它來閱讀和展示模型中的一些數據。
在控制器中我調用Action Helper作爲代理方法,但是如何在View Helper中實現相同的功能?
某處控制器:
$this->_helper->Service("Custom\\PageService");
Service.php:
...
public function direct($serviceClass)
{
return new $serviceClass($this->em);
}
問題保持這將是更好的解決方案。我認爲第一個因爲你不依賴'Controller'。你怎麼看? – pixel
毫無疑問,第一個將是更好的解決方案。 –