(Yaf >=1.0.0)
Yaf_Controller_Abstract 锟斤拷Yaf锟斤拷MVC锟斤拷系锟侥猴拷锟侥诧拷锟街★拷 MVC锟斤拷指Model-View-Controller, 锟斤拷一锟斤拷锟斤拷锟节凤拷锟斤拷应锟斤拷锟竭硷拷锟酵憋拷锟斤拷锟竭硷拷锟斤拷锟斤拷锟侥J斤拷锟�
每锟斤拷锟矫伙拷锟皆讹拷锟斤拷controller锟斤拷应锟斤拷锟教筹拷Yaf_Controller_Abstract锟斤拷
锟斤拷岱拷锟斤拷锟斤拷锟斤拷约锟斤拷锟絚ontroller锟斤拷锟睫凤拷锟斤拷锟斤拷__construct锟斤拷锟斤拷锟斤拷锟斤拷耍锟�Yaf_Controller_Abstract 锟结供锟斤拷一锟斤拷魔锟斤拷锟斤拷锟斤拷Yaf_Controller_Abstract::init()锟斤拷
锟斤拷锟斤拷锟斤拷锟斤拷约锟斤拷锟絚ontroller锟斤拷锟斤拷锟窖撅拷锟斤拷锟斤拷锟斤拷一锟斤拷init()锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟絚ontroller锟斤拷实锟斤拷锟斤拷锟斤拷时锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟矫★拷
Action锟斤拷锟斤拷锟斤拷要锟斤拷锟斤拷锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷时锟斤拷锟斤拷路锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥诧拷锟斤拷锟斤拷锟斤拷同锟斤拷锟狡的憋拷锟斤拷锟斤拷锟斤拷锟界:Yaf_Request_Abstract::getParam()锟斤拷锟斤拷 Yaf锟斤拷锟斤拷锟斤拷锟角达拷锟捷革拷action锟斤拷锟斤拷锟斤拷see Yaf_Action_Abstract::execute()锟斤拷锟斤拷
$module
[, string $controller
[, string $action
[, array $paramters
]]] ) : void锟斤拷也锟斤拷锟斤拷通锟斤拷使锟斤拷锟斤拷锟街碉拷锟� Yaf_Action_Abstract 锟斤拷一锟斤拷锟斤拷锟斤拷锟斤拷PHP锟脚憋拷锟叫讹拷锟斤拷action锟斤拷锟斤拷锟斤拷
Example #1 锟斤拷一锟斤拷锟斤拷锟斤拷锟斤拷锟侥硷拷锟叫讹拷锟斤拷action
<?php
class IndexController extends Yaf_Controller_Abstract {
protected $actions = array(
/** now dummyAction is defined in a separate file */
"dummy" => "actions/Dummy_action.php",
);
/* action method may have arguments */
public indexAction($name, $id) {
assert($name == $this->getRequest()->getParam("name"));
assert($id == $this->_request->getParam("id"));
}
}
?>
Example #2 Dummy_action.php
<?php
class DummyAction extends Yaf_Action_Abstract {
/* a action class shall define this method as the entry point */
public execute() {
}
}
?>
模锟斤拷锟斤拷
锟斤拷前锟斤拷锟斤拷锟斤拷实锟斤拷
锟斤拷图锟斤拷锟斤拷