Hello,

I am trying to access request object parameters within the context of a resource plugin. Dumping the entire request object works as expected:

...
$this->getBootstrap()->bootstrap('frontController');
$this->getBootstrap()->bootstrap('view');
...
$front       = $this->getBootstrap()->getResource('frontController');
$view        = $this->getBootstrap()->getResource('view');
...
$request     = new Zend_Controller_Request_Http();
$front->setRequest($request);
$request     = $front->getRequest();
$view->debug = $request;


E.g. for a url like

http://localhost/en/index/index/id/1/page/3/current/4

the output (<pre><?php print_r($this->debug); ?></pre> reads as follows:

***********************************************************************
Zend_Controller_Request_Http Object
(
    [_paramSources:protected] => Array
        (
            [0] => _GET
            [1] => _POST
        )

    [_requestUri:protected] => /en/index/index/id/1/page/3/current/4
    [_baseUrl:protected] =>
    [_basePath:protected] =>
    [_pathInfo:protected] => /en/index/index/id/1/page/3/current/4
    [_params:protected] => Array
        (
            [lang] => en
            [controller] => index
            [action] => index
            [id] => 1
            [page] => 3
            [current] => 4
            [module] => default
        )

    [_rawBody:protected] =>
    [_aliases:protected] => Array
        (
        )

    [_dispatched:protected] => 1
    [_module:protected] => default
    [_moduleKey:protected] => module
    [_controller:protected] => index
    [_controllerKey:protected] => controller
    [_action:protected] => index
    [_actionKey:protected] => action
)
***********************************************************************

If, however, I try to access all or individual parameters, e.g.

$view->debug = $request->getParams() [OR]
$view->debug = $request->getParams('lang')

I get an empty list (resp. string). Since I am pretty new to Zend_Application any help would be much appreciated!

Thank you very much in advance.

Stefan

Reply via email to