views:

34

answers:

1
$pages = array(
       array(
          'label'    => 'Search',
          'title'    => 'Please Search',
          'uri'      => 'Search.php',
          'params'   => array('stcode'=>$stcode)
        ));

now the pages array will be passed to the zend_naviagtion

 $container = new Zend_Navigation($pages);
 $view->getHelper('navigation')->setContainer($container);

I have a couple of items in the pages array which will help me displaying the menu when the menu is generated when i click on that search page and it is taking me to the index.php as the code is written if stcode is not present then it will redirect to index.php .Now my problem is how do i pass the stcode to that page

+1  A: 

Do you mean doing it via the ZF Request Object, like so:

$this->getRequest()->setParam("stcode", $the_value);

Which can then be accessed like so

$this->getRequest()->getParam("stcode");

// You can also pass an optional default value
$this->getRequest()->getParam("stcode", "wibble");

Or like so

// This has no default value and may return an error depending on your configuration
$this->getRequest()->stcode;
jakenoble