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


PHP sfWebResponse::setParameter方法代码示例

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


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

示例1: check_stylesheets_included

        $response->addStylesheet('first2', 'first');
        $response->addStylesheet('multiple', 'last');
        $filterChain->execute();
        // sfCommmonFilter has executed all its code
    }
}
$context = sfContext::getInstance();
$context->request = new myRequest();
$response = new sfWebResponse();
$response->initialize($context);
$context->response = $response;
$selector = execute_filter_chain($context, $t);
check_javascripts_included($t, $selector);
check_stylesheets_included($t, $selector);
// test disabling javascript and stylesheet automatic inclusion
$response->setParameter('stylesheets_included', true, 'symfony/view/asset');
$response->setParameter('javascripts_included', true, 'symfony/view/asset');
$selector = execute_filter_chain($context, $t);
$t->is($selector->getElements('head script'), array(), '->execute() does not add javascripts if you used get_javascripts() helper');
$t->is($selector->getElements('head link'), array(), '->execute() does not add stylesheets if you used get_stylesheets() helper');
$response->setParameter('stylesheets_included', true, 'symfony/view/asset');
$response->setParameter('javascripts_included', false, 'symfony/view/asset');
$selector = execute_filter_chain($context, $t);
check_javascripts_included($t, $selector);
$t->is($selector->getElements('head link'), array(), '->execute() does not add javascripts if you used get_javascripts() helper');
$response->setParameter('stylesheets_included', false, 'symfony/view/asset');
$response->setParameter('javascripts_included', true, 'symfony/view/asset');
$selector = execute_filter_chain($context, $t);
$t->is($selector->getElements('head script'), array(), '->execute() does not add javascripts if you used get_javascripts() helper');
check_stylesheets_included($t, $selector);
function check_stylesheets_included($t, $selector)
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:sfCommonFilterTest.php


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