Yaf_Request_Abstract::isDispatched

(Yaf >=1.0.0)

Yaf_Request_Abstract::isDispatched判断请求是否已分发

说明

public function Yaf_Request_Abstract::isDispatched(): bool

判断请求是否已被分发。

参数

此函数没有参数。

返回值

如果请求已被分发则返回 true,否则返回 false

示例

示例 #1 Yaf_Request_Abstract::isDispatched() 示例

<?php
class IndexController extends Yaf_Controller_Abstract
{
    public function indexAction()
    {
        // 停止分发循环,不再分发后续的 action
        $this->getRequest()->setDispatched();

        var_dump($this->getRequest()->isDispatched());
    }
}
?>

以上示例的输出类似于:

bool(true)

参见