当前位置: 首页>>代码示例>>PHP>>正文


PHP sfFilterChain::register方法代码示例

本文整理汇总了PHP中sfFilterChain::register方法的典型用法代码示例。如果您正苦于以下问题:PHP sfFilterChain::register方法的具体用法?PHP sfFilterChain::register怎么用?PHP sfFilterChain::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sfFilterChain的用法示例。


在下文中一共展示了sfFilterChain::register方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute_filter_chain

function execute_filter_chain($context, $t)
{
    $filterChain = new sfFilterChain();
    $filter = new lastTestFilter($context);
    $filter->response = $context->response;
    $filterChain->register($filter);
    $filter = new sfCommonFilter($context);
    $filterChain->register($filter);
    $filter = new firstTestFilter($context);
    $filter->response = $context->response;
    $filterChain->register($filter);
    $filterChain->execute();
    $dom = new DomDocument('1.0', 'UTF-8');
    $dom->validateOnParse = true;
    $dom->loadHTML($context->response->getContent());
    $selector = new sfDomCssSelector($dom);
    return $selector;
}
开发者ID:mediasadc,项目名称:alba,代码行数:18,代码来源:sfCommonFilterTest.php

示例2: sfContext

        // sfFlashFilter has executed no code
        // register some flash from previous request
        $user->setAttribute('previous_request', 'foo', 'symfony/flash');
        $user->setAttribute('every_request', 'foo', 'symfony/flash');
        $filterChain->execute();
        // sfFlashFilter has executed all its code
        $t->ok(!$user->hasAttribute('previous_request', 'symfony/flash'), '->execute() removes flash variables that have been tagged before');
        $t->ok(!$user->hasAttribute('previous_request', 'symfony/flash/remove'), '->execute() removes flash variables that have been tagged before');
        $t->is($user->getAttribute('this_request', null, 'symfony/flash'), 'foo', '->execute() keeps current request flash variables');
        $t->is($user->getAttribute('every_request', null, 'symfony/flash'), 'foo', '->execute() flash variables that have been overriden in current request');
    }
}
$context = new sfContext();
$user = new myUser();
$user->initialize($context);
$context->user = $user;
$filterChain = new sfFilterChain();
$filter = new lastTestFilter();
$filter->t = $t;
$filter->user = $user;
$filter->initialize($context);
$filterChain->register($filter);
$filter = new sfFlashFilter();
$filter->initialize($context);
$filterChain->register($filter);
$filter = new firstTestFilter();
$filter->t = $t;
$filter->user = $user;
$filter->initialize($context);
$filterChain->register($filter);
$filterChain->execute();
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:sfFlashFilterTest.php


注:本文中的sfFilterChain::register方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。