本文整理汇总了PHP中ResourceLoaderContext::getDirection方法的典型用法代码示例。如果您正苦于以下问题:PHP ResourceLoaderContext::getDirection方法的具体用法?PHP ResourceLoaderContext::getDirection怎么用?PHP ResourceLoaderContext::getDirection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResourceLoaderContext
的用法示例。
在下文中一共展示了ResourceLoaderContext::getDirection方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDirection
public function getDirection()
{
if ($this->direction === self::INHERIT_VALUE) {
return $this->context->getDirection();
}
if ($this->direction === null) {
$this->direction = Language::factory($this->getLanguage())->getDir();
}
return $this->direction;
}
示例2: getDirection
public function getDirection()
{
if (!is_null($this->direction)) {
return $this->direction;
} else {
return $this->context->getDirection();
}
}
示例3: testTypicalRequest
public function testTypicalRequest()
{
$ctx = new ResourceLoaderContext($this->getResourceLoader(), new FauxRequest(['debug' => 'false', 'lang' => 'zh', 'modules' => 'foo|foo.quux,baz,bar|baz.quux', 'only' => 'styles', 'skin' => 'fallback']));
// Request parameters
$this->assertEquals($ctx->getModules(), ['foo', 'foo.quux', 'foo.baz', 'foo.bar', 'baz.quux']);
$this->assertEquals(false, $ctx->getDebug());
$this->assertEquals('zh', $ctx->getLanguage());
$this->assertEquals('styles', $ctx->getOnly());
$this->assertEquals('fallback', $ctx->getSkin());
$this->assertEquals(null, $ctx->getUser());
// Misc
$this->assertEquals('ltr', $ctx->getDirection());
$this->assertEquals('zh|fallback|||styles|||||', $ctx->getHash());
}
示例4: getPath
/**
* Get the path to image file for given context.
*
* @param ResourceLoaderContext $context Any context
* @return string
*/
public function getPath(ResourceLoaderContext $context)
{
$desc = $this->descriptor;
if (is_string($desc)) {
return $this->basePath . '/' . $desc;
} elseif (isset($desc['lang'][$context->getLanguage()])) {
return $this->basePath . '/' . $desc['lang'][$context->getLanguage()];
} elseif (isset($desc[$context->getDirection()])) {
return $this->basePath . '/' . $desc[$context->getDirection()];
} else {
return $this->basePath . '/' . $desc['default'];
}
}
示例5: getFlip
/**
* Get whether CSS for this module should be flipped
* @param ResourceLoaderContext $context
* @return bool
*/
public function getFlip($context)
{
return $context->getDirection() === 'rtl';
}
示例6: getFlip
/**
* @param ResourceLoaderContext $context
* @return bool
*/
public function getFlip($context)
{
global $wgContLang;
return $wgContLang->getDir() !== $context->getDirection();
}
示例7: getFlip
/**
* Get whether CSS for this module should be flipped
* @param ResourceLoaderContext $context
* @return bool
*/
public function getFlip($context)
{
return $context->getDirection() === 'rtl' && !$this->noflip;
}