Hello,
ATM I set the currency and locale objects in the bootstrap and assign them to zend registry.
Then in the controller that needs them, In the init I do:
public function Init() {
$this->locale = Zend_Registry::get('locale');
$this->currency = Zend_Registry::get('currency');
}
I was wondering if there's away to make variables and objects accessible through the controller classes?
I figure the controllers extend Zend_Controller_Action so I just need to make it a var in that class somehow in the bootstrap?
Edit, so after much testing, I've added this to my bootstrap:
protected function _initFrontTController() {
$frontController = Zend_Controller_Front::getInstance();
//$frontController->setControllerDirectory(ROOT_PATH.'/application/modules/', 'default');
if($frontController->getParam('bootstrap') === null) {
$frontController->setParam('bootstrap', $this);
}
return $frontController;
}
If I name it _initFrontController I get
Zend_Controller_Exception: No default module defined for this application in
If I set it to the right module, I get:
Zend_Controller_Dispatcher_Exception: Invalid controller specified (error) in
Not sure the best way to proceed, for now it works I guess :(