當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FA::stack方法代碼示例

本文整理匯總了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>');
 }
開發者ID:wozhen,項目名稱:yii2-cms-writedown,代碼行數:9,代碼來源:MainTest.php

示例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;
 }
開發者ID:max-wen,項目名稱:yii2-app-advanced-autoEnv,代碼行數:11,代碼來源:MainTest.php


注:本文中的rmrevin\yii\fontawesome\FA::stack方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。