Thursday, October 21, 2010

Access Controller variable in tpl file in Zend Framework


How to access Controller variable in tpl file in Zend Framework

In controller assign the variable name and it's value as listed below:

Controller file name EditController.php
---------------------------
//$this->view->assign('VARIABLE-NAME', 'VARIABLE-VALUE');
$this->view->assign('listing_id_for_view', $listing_id_for_view);


index.tpl:
---------------
 Access here as listed below:
<?php echo "Your listing id is : ".$this->listing_id_for_view ; ?>




No comments:

Post a Comment