Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <td>{$row->bstate|state}</td>
- class HomepagePresenter extends BasePresenter
- {
- protected function createTemplate($class = NULL)
- {
- $template = parent::createTemplate($class);
- $template->registerHelperLoader('Library\Utils\BookHelpers::loader');
- return $template;
- }
- <?php
- namespace Library\Utils;
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- * Description of BookHelpers
- *
- * @author patrik
- */
- final class BookHelpers
- {
- /**
- * Try to load the requested helper.
- * @param string helper name
- * @return callback
- */
- public static function loader($helper)
- {
- if (method_exists(__CLASS__, $helper)) {
- return callback(__CLASS__, $helper);
- }
- }
- public static function state($x)
- {
- eval('$var = Library\BookState::$'.$x . ';');
- return $var;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment