本文整理汇总了PHP中ResourceLoaderContext::shouldIncludeStyles方法的典型用法代码示例。如果您正苦于以下问题:PHP ResourceLoaderContext::shouldIncludeStyles方法的具体用法?PHP ResourceLoaderContext::shouldIncludeStyles怎么用?PHP ResourceLoaderContext::shouldIncludeStyles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResourceLoaderContext
的用法示例。
在下文中一共展示了ResourceLoaderContext::shouldIncludeStyles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testShouldInclude
public function testShouldInclude()
{
$ctx = new ResourceLoaderContext($this->getResourceLoader(), new FauxRequest([]));
$this->assertTrue($ctx->shouldIncludeScripts(), 'Scripts in combined');
$this->assertTrue($ctx->shouldIncludeStyles(), 'Styles in combined');
$this->assertTrue($ctx->shouldIncludeMessages(), 'Messages in combined');
$ctx = new ResourceLoaderContext($this->getResourceLoader(), new FauxRequest(['only' => 'styles']));
$this->assertFalse($ctx->shouldIncludeScripts(), 'Scripts not in styles-only');
$this->assertTrue($ctx->shouldIncludeStyles(), 'Styles in styles-only');
$this->assertFalse($ctx->shouldIncludeMessages(), 'Messages not in styles-only');
$ctx = new ResourceLoaderContext($this->getResourceLoader(), new FauxRequest(['only' => 'scripts']));
$this->assertTrue($ctx->shouldIncludeScripts(), 'Scripts in scripts-only');
$this->assertFalse($ctx->shouldIncludeStyles(), 'Styles not in scripts-only');
$this->assertFalse($ctx->shouldIncludeMessages(), 'Messages not in scripts-only');
}