本文整理汇总了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)