Re: [fw-general] Zend_Application + Controller > Action

2009-04-08 Thread Elvin Şiriyev
i know view helpers. but i think this is expensive and there must be an other (pre defined) ways. whatever. thank a lot 2009/4/8 Thomas VEQUAUD > You'd better use Zend_View_Helper : > > *Just a little example* > 1. In /application/views/script/helpers/ControllerName.php > class Zend_View_Helpe

Re: [fw-general] Zend_Application + Controller > Action

2009-04-08 Thread Thomas VEQUAUD
You'd better use Zend_View_Helper : *Just a little example* 1. In /application/views/script/helpers/ControllerName.php class Zend_View_Helper_ControllerName { function controllerName() { // Controller name $fc = Zend_Controller_Front::getInstance(); $request = $fc->

Re: [fw-general] Zend_Application + Controller > Action

2009-04-08 Thread Elvin Şiriyev
another question for layout. for http://www.w3.org/1999/xhtml"; xml:lang="translate->getLocale()?>" lang="translate->getLocale()?>"> i solved it like abstract App_Controller_Action extends Zend_Controller_Action { function init(){ parent::init(); $this->trans

Re: [fw-general] Zend_Application + Controller > Action

2009-04-08 Thread keith Pope
Accessing from controller is done via $this->getInvokeArg(), if you use FC parameter. You may want to look at why you want to have config, cache and locale access in your view, generally this would happen in the Model or controller. If you do need to do this I would suggest using a view helper, t

Re: [fw-general] Zend_Application + Controller > Action

2009-04-08 Thread Elvin Şiriyev
2. way sounds good. but how can i access frontController's params from controller and view script ? i dont like write that codes for each Action -- $config = Zend_Registry::get('Zend_Config'); $cache = Zend_Registry::get('Zend_Cache'); $locale = Zend_Registry::get('Z

Re: [fw-general] Zend_Application + Controller > Action

2009-04-08 Thread keith Pope
Maybe use the registry for that, so have a bootstrap class resource that fetches the plugin resources: protected _initRegistry() { $this->bootstrap('db'); Zend_Registry::set('dbResource', $this->getPluginResource('db')); } Or you could pass them as params to the front controller, which wo

[fw-general] Zend_Application + Controller > Action

2009-04-08 Thread Elvin Şiriyev
hi, i used Zend_Application with Zend_Application_Resource_*. how can i access to that objects from my Controller and view? for example is there any way to access Zend_Application_Resource_ Navigation 's getContainer() method from controller like $this->navigation->getContainer() or $this->db, $t