Now I have them set in my bootstrap.php and Im trying to access the variable but i am not getting anything: (Using version 1.11)
PHP Code:
//BootStrap.php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
public function initWithRoutes(){
$frontController = Zend_Controller_Front::getInstance();
$router = $frontController->getRouter();
$router->addRouter(
'itemParam',
new Zend_Controller_Router_Route(
'/display/:item',
array('controller' => 'products', 'action' => 'display')
)
);
}
}
And this is my Controller:
PHP Code:
//ProductsController.php
class ProductsController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
// action body
}
public function displayAction(){
if($this->getRequest()->getParam('item')){
$this->view->product = $this->_request()->getParam('item');
} else {
$this->view->product = 'nothing was passed';
}
}
}
And finally my view:
PHP Code:
//display.phtml
<?php echo $this->product; ?>
I wonder what I'm now getting wrong
Bookmarks