Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #uri - action is translated dynamically, same with parameters
- # /?pagename=user&action=findcity&term=Lond
- # Custom page template file
- <?php
- /*
- Template Name: templateName
- */
- $controllerManager = getControllerManager();
- $controllerManager->doAction('User'); #User is controller name, action translation is done
- # controller action example, inside UserController class
- public function findcityAction()
- {
- require_once __DIR__.'/../models/City.php';
- $city = new City($this->_container);
- $cities = $city->getCities($this->getParam('term'));
- return $this->getHelper('Json')->send(
- $cities
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement