Hello Federico!
I work with the version ZendFramework 1.10.x.
I am guided by the following example:
http://www.raintpl.com/News/2011/02/17/Integrating-Rain-TPL-into-Zend/
I modified the application.ini:
raintpl.tpl_dir = ". / tpl /"
raintpl.cache_dir = ". / cache /"
autoloader namespaces [] = 'Raintpl'
The template directory and the cache directory is
folder in the 'public'.
In the 'library' I have created a directory called 'Raintpl'.
In this directory contains the class 'Raintpl.php' and
'View.php'.
The class 'Raintpl' was rewritten
'class Raintpl_Raintpl{ ... } '.
The class 'View.php' was rewritten in
'class Raintpl_View{ ... }'
In the bootstrap I created a _initView.
protected function _initView () {
$options = $this->getOption('raintpl');
$raintpl = new Raintpl_View($options);
$viewRender =
Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$viewRender->setView($raintpl);
$viewRender->setViewSuffix('html');
Zend_Controller_Action_HelperBroker::addHelper($viewRender);
return $viewRender;
}
In the class 'View' I have adapted the method __ construct(){ ... }.
public function __ construct ($ data) {
parent :: __construct ($ data);
$ this->_raintpl = new Raintpl_Raintpl();
Raintpl_Raintpl ::$tpl_dir = $ data ['tpl_dir'];
Raintpl_Raintpl ::$cache_dir = $ data ['cache_dir'];
}
In my project there is a controller.
http://myblog1/blog/index/index/
This controller handles the action 'index'
public function index action () {
$ model = new Blog_Model_Index ();
$ row = $ model-> start ();
$ this-> view-> assign ('test', 'ABC');
$ this-> view-> render ('Blog_Index_Index');
}
At the moment I see an empty output without an error message.
Where is the mistake?
Yours sincerely,
Stephan