Hi, im just a newbie with ZF.

I just wanted to move view folder to another path. It seems it can be done
with addBasePath() but here comes the questions.

It does work if i add "$this->view->addBasePath..." in the current
action but isn't it stupid to add this line in every action?
So i've tried $this->view->addBasePath... in controller's
init() function which works too. But honestly, this is not the correct
way neither.

Suppose i prepared my $view object with all the paths helpers etc. and put
it in registry. Then calling it with:

public function init() {
this->view = Zend_Registry::get('view');
}

Which simply does not work. Im trying to do that around 2 days and i gave
up. Everything looks ok in action:
public function indexAction() {
  print_r($this->view);
}
gives the correct dump of view paths but it just NOT working.

Also i think it's stupid to assign view object from registry in
every controller's init. Don't we have some mothod like;
$controller->setParam('defaultViewObject', $view);
we can do it in bootstrap only once after setting everything about $view?

PS: I've found a solution here exactly what i want but it gives fatal error:
http://www.nabble.com/ViewRenderer-action-helper-now-in-core.-td10745347ef16154.html

Reply via email to