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,
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,
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
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 =
another question for layout.
for
html xmlns=http://www.w3.org/1999/xhtml;
xml:lang=?=$this-translate-getLocale()?
lang=?=$this-translate-getLocale()?
i solved it like
abstract App_Controller_Action extends Zend_Controller_Action {
function init(){
parent::init();
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 =
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 thomas.vequ...@gmail.com
You'd better use Zend_View_Helper :
*Just a little example*
1. In /application/views/script/helpers/ControllerName.php