Hi,
I've developed a module and I need to extend it just to provide a different
layout/source (database). Since my database models use Zend_Db i've added a
prefix to the construct so I have different tables with the same columns.
ex. tables news and foo_news
My extended controller looks like this
Foonews_IndexController extends News_IndexController
{
init()
{
$this->_request->setParam('prefix', 'foo');
parent::init();
}
}
The problem is that when I call the Foonews index action it renders the
index.tpl of news instead of foonews.
Ex.
News_IndexController
{
function init()
{
$this->_prefix = $this->_request->getParam('prefix');
}
function indexAction()
{
// do the business
$this->render('index'); // Renders the
application/news/views/scripts/index/index.tpl
$this->render('foo_index'); // Renders the
application/foonews/views/scripts/index/foo-index.tpl
$this->render('en/index'); // Renders the
application/foonews/views/scripts/index/en/index.tpl
}
}
I am using a view helper in order to use smarty as template system so it can
be a problem with the class that I am using so I am looking for tips to
either replace it for a new one or correct that (if I know what is wrong).
The class is Naneau_View_Smarty (
http://naneau.nl/category/web-development/zend-framework/)
Regards.