Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class ProductsController extends Zend_Controller_Action
- {
- public function init()
- {
- $this->products = array(
- 'fruit'=>'apples',
- 'veggies'=>'cauliflour',
- 'clothes'=>'shirt',
- 'footwear'=>'boots',
- );
- }
- public function indexAction()
- {
- echo '<pre>'; print_r($this->products); echo '</pre>';
- }
- public function __call($method,$args) {
- // $method is the method name which contains 'Action'
- $username=ucwords(substr($method,0, -6)); // so we remove 'Action' from the end
- $this->view->username=$username;
- $this->render('user'); // renders application/views/scripts/user/user.phtml
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement