本文整理汇总了PHP中rmrevin\yii\fontawesome\FA::Icon方法的典型用法代码示例。如果您正苦于以下问题:PHP FA::Icon方法的具体用法?PHP FA::Icon怎么用?PHP FA::Icon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rmrevin\yii\fontawesome\FA
的用法示例。
在下文中一共展示了FA::Icon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: testStackOutput
public function testStackOutput()
{
$this->assertEquals((string) FA::stack(), '<span class="fa-stack"></span>');
$this->assertEquals((string) FA::stack()->tag('div'), '<div class="fa-stack"></div>');
$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>');
$this->assertEquals((string) FA::stack()->icon(FA::Icon('cog')->spin())->on(FA::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>');
$this->assertNotEquals((string) FA::stack()->icon((string) FA::Icon('cog')->spin())->on((string) FA::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>');
}