Zend_Controller_Action_HelperBroker::addPath( APPLICATION_PATH .'/controllers/helpers'); |
class Zend_Controller_Action_Helper_Multiples extends Zend_Controller_Action_Helper_Abstract{ function direct($a) { return $a * 2; } function thrice($a) { return $a * 3; } } |
class IndexController extends Zend_Controller_Action { public function indexAction() { $number = 30; $twice = $this->_helper->multiples($number); $thrice = $this->_helper->multiples->thrice($number); $this->view->number = $number;//30 $this->view->twice = $twice;//60 $this->view->thrice = $thrice;//90 }} |
欢迎光临 纳速健身 (https://nasue.com/) | Powered by Discuz! X3.4 |