Nilson
10.08.2007, 14:07
Hi, nach einer langen Pause mit dem ZF wollte ich nun mal wieder etwas programmieren...
naja nun hapert es aber schon an meiner Erweiterung der Action-Klasse
abstract class Nilson_Controller_Action extends Zend_Controller_Action
{
protected $_template = 'index/index.phtml';
protected $_cacheTpl = false;
protected $_cacheId = false;
protected $_cacheTag = array();
public function init()
{
$this->initView(); // Get View
}
public function _destruct()
{
if (!$this->_cacheTpl)
{
$this->_cacheTpl = $this->view->render($this->_template);
if ($this->_cacheId)
{
Zend_Registry::get('templateCache')->save($this->_cacheTpl, $this->_cacheId, $this->_cacheTag);
}
}
echo $this->_cacheTpl; // Show Page
}
}
Naja Problem ist dass er gar nicht das Index-Template rendert sondern das Template was den Namen des Controllers hat.... :(
Hoffe ihr versteht was ich meine :)
MFG Nilson
naja nun hapert es aber schon an meiner Erweiterung der Action-Klasse
abstract class Nilson_Controller_Action extends Zend_Controller_Action
{
protected $_template = 'index/index.phtml';
protected $_cacheTpl = false;
protected $_cacheId = false;
protected $_cacheTag = array();
public function init()
{
$this->initView(); // Get View
}
public function _destruct()
{
if (!$this->_cacheTpl)
{
$this->_cacheTpl = $this->view->render($this->_template);
if ($this->_cacheId)
{
Zend_Registry::get('templateCache')->save($this->_cacheTpl, $this->_cacheId, $this->_cacheTag);
}
}
echo $this->_cacheTpl; // Show Page
}
}
Naja Problem ist dass er gar nicht das Index-Template rendert sondern das Template was den Namen des Controllers hat.... :(
Hoffe ihr versteht was ich meine :)
MFG Nilson