本文整理匯總了PHP中rmrevin\yii\fontawesome\FA::stack方法的典型用法代碼示例。如果您正苦於以下問題:PHP FA::stack方法的具體用法?PHP FA::stack怎麽用?PHP FA::stack使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rmrevin\yii\fontawesome\FA
的用法示例。
在下文中一共展示了FA::stack方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testStackOutput
public function testStackOutput()
{
$this->assertEquals((string) FA::stack(), '<span class="fa-stack"></span>');
$this->assertEquals((string) FA::stack()->icon('cog'), '<span class="fa-stack"><i class="fa fa-cog fa-stack-1x"></i></span>');
$this->assertEquals((string) FA::stack()->on('square-o'), '<span class="fa-stack"><i class="fa fa-square-o fa-stack-2x"></i></span>');
$this->assertEquals((string) FA::stack()->icon('cog')->on('square-o'), '<span class="fa-stack"><i class="fa fa-square-o fa-stack-2x"></i><i class="fa fa-cog fa-stack-1x"></i></span>');
$this->assertEquals((string) FA::stack(['data-role' => 'stack'])->icon('cog', ['data-role' => 'icon'])->on('square-o', ['data-role' => 'background']), '<span class="fa-stack" data-role="stack"><i class="fa fa-square-o fa-stack-2x" data-role="background"></i><i class="fa fa-cog fa-stack-1x" data-role="icon"></i></span>');
$this->assertEquals((string) FA::stack()->icon((new Icon('cog'))->spin())->on((new Icon('square-o'))->size(FA::SIZE_3X)), '<span class="fa-stack"><i class="fa fa-square-o fa-3x fa-stack-2x"></i><i class="fa fa-cog fa-spin fa-stack-1x"></i></span>');
}
示例2: testAnotherPrefix
public function testAnotherPrefix()
{
$old_prefix = FA::$cssPrefix;
FA::$cssPrefix = 'fontawesome';
$this->assertEquals(FA::icon('cog'), '<i class="fontawesome fontawesome-cog"></i>');
$this->assertEquals(FA::icon('cog')->tag('span'), '<span class="fontawesome fontawesome-cog"></span>');
$this->assertEquals(FA::icon('cog')->addCssClass('highlight'), '<i class="fontawesome fontawesome-cog highlight"></i>');
$this->assertEquals((string) FA::stack()->icon(FA::Icon('cog')->spin())->on(FA::Icon('square-o')->size(FA::SIZE_3X)), '<span class="fontawesome-stack"><i class="fontawesome fontawesome-square-o fontawesome-3x fontawesome-stack-2x"></i><i class="fontawesome fontawesome-cog fontawesome-spin fontawesome-stack-1x"></i></span>');
$this->assertEquals((string) FA::ul()->item('cog', 'Gear'), '<ul class="fontawesome-ul"><li><i class="fontawesome fontawesome-cog fontawesome-li"></i>Gear</li></ul>');
FA::$cssPrefix = $old_prefix;
}