Yet Another Framework Yaf_Action_Abstract::execute
(Yaf >=1.0.0)
Yaf_Action_Abstract::execute — Action entry point
설명
abstract public Yaf_Action_Abstract::execute(mixed ...$args
): mixed
사용자는 항상 작업에 대해 이 메서드를 정의해야 하며 이는 작업의 진입점입니다. Yaf_Action_Abstract::execute()에 agrurments가 있을 수 있습니다.
메모: 요청에서 검색된 값이 안전하지 않습니다. 사용하기 전에 필터링 작업을 수행해야 합니다.
매개변수
args
반환 값
Examples
예제 #1 Yaf_Action_Abstract::execute() 예제
<?php
/**
* A controller example
*/
class ProductController extends Yaf_Controller_Abstract {
protected $actions = array(
"index" => "actions/Index.php",
);
}
?>
예제 #2 Yaf_Action_Abstract::execute() 예제
<?php
/**
* ListAction
*/
class ListAction extends Yaf_Action_Abstract {
public function execute ($name, $id) {
assert($name == $this->getRequest()->getParam("name"));
assert($id == $this->getRequest()->getParam("id"));
}
}
?>
위의 예는 다음과 유사한 결과를 출력합니다.
/** * Now assuming we are using the Yaf_Route_Static route * for request: http://yourdomain/product/list/name/yaf/id/22 * will result: */ bool(true) bool(true)