• composer 安装yii插件 fontawesome


    国外站点 http://fontawesome.io/

    国内站点 http://fontawesome.dashgame.com/

    Installation 

    The preferred way to install this extension is through composer.

    Either run

    composer require "rmrevin/yii2-fontawesome:2.10.*"
    

    or add

    "rmrevin/yii2-fontawesome": "2.10.*",
    

    to the require section of your composer.json file.

    Usage 

    In view

    rmrevinyiifontawesomeAssetBundle::register($this);

    or as dependency in your main application asset bundle

    class AppAsset extends AssetBundle
    {
        // ...
     
        public $depends = [
            // ...
            '
    mrevinyiifontawesomeAssetBundle'
        ];
    }

    Helper 

    use rmrevinyiifontawesomeFA;
     
    echo FA::icon('home'); // <i class="fa fa-home"></i>
    echo FA::icon(
        'arrow-left', 
        ['class' => 'big', 'data-role' => 'arrow']
    ); // <i class="big fa fa-arrow-left" data-role="arrow"></i>
     
    echo Html::submitButton(
        Yii::t('app', '{icon} Save', ['icon' => FA::icon('check')])
    ); // <button type="submit"><i class="fa fa-check"></i> Save</button>
     
    echo FA::icon('cog')->inverse();    // <i class="fa fa-cog fa-inverse"></i>
    echo FA::icon('cog')->spin();       // <i class="fa fa-cog fa-spin"></i>
    echo FA::icon('cog')->fixedWidth(); // <i class="fa fa-cog fa-fw"></i>
    echo FA::icon('cog')->ul();         // <i class="fa fa-cog fa-ul"></i>
    echo FA::icon('cog')->li();         // <i class="fa fa-cog fa-li"></i>
    echo FA::icon('cog')->border();     // <i class="fa fa-cog fa-border"></i>
    echo FA::icon('cog')->pullLeft();   // <i class="fa fa-cog pull-left"></i>
    echo FA::icon('cog')->pullRight();  // <i class="fa fa-cog pull-right"></i>
     
    echo FA::icon('cog')->size(FA::SIZE_3X);
    // values: FA::SIZE_LARGE, FA::SIZE_2X, FA::SIZE_3X, FA::SIZE_4X, FA::SIZE_5X
    // <i class="fa fa-cog fa-size-3x"></i>
     
    echo FA::icon('cog')->rotate(FA::ROTATE_90); 
    // values: FA::ROTATE_90, FA::ROTATE_180, FA::ROTATE_180
    // <i class="fa fa-cog fa-rotate-90"></i>
     
    echo FA::icon('cog')->flip(FA::FLIP_VERTICAL); 
    // values: FA::FLIP_HORIZONTAL, FA::FLIP_VERTICAL
    // <i class="fa fa-cog fa-flip-vertical"></i>
     
    echo FA::icon('cog')
            ->spin()
            ->fixedWidth()
            ->pullLeft()
            ->size(FA::SIZE_LARGE);
    // <i class="fa fa-cog fa-spin fa-fw pull-left fa-size-lg"></i>
     
    echo FA::stack()
            ->icon('twitter')
            ->on('square-o');
    // <span class="fa-stack">
    //   <i class="fa fa-square-o fa-stack-2x"></i>
    //   <i class="fa fa-twitter fa-stack-1x"></i>
    // </span>
     
    echo FA::stack(['data-role' => 'stacked-icon'])
         ->on((new FAIcon('square'))->inverse())
         ->icon((new FAIcon('cog'))->spin());
    // <span class="fa-stack" data-role="stacked-icon">
    //   <i class="fa fa-square-o fa-inverse fa-stack-2x"></i>
    //   <i class="fa fa-cog fa-spin fa-stack-1x"></i>
    // </span>
     
    // autocomplete icons name in IDE
    echo FA::icon(FA::_COG);
    echo FA::icon(FA::_DESKTOP);
    echo FA::stack()
         ->on((new FAIcon(FA::_SQUARE))->inverse())
         ->icon((new FAIcon(FA::_COG))->spin());

    Set another prefix 

    FA::$cssPrefix = 'awf';
     
    echo FA::icon('home');
    // <i class="awf awf-home"></i>
    echo FA::icon('cog')->inverse();
    // <i class="awf awf-cog awf-inverse"></i>
  • 相关阅读:
    第一篇:GCD的使用
    第一篇:线程的安全
    内存问题
    第一篇:多线程的概念
    第一篇:NSOperation的概念
    存储问题
    第一篇:NSTread线程的创建
    第一篇:多线程使用
    遍历所有表,取每个表的MAXID更新到ID控制表
    <转载>SQL查询数据库各表所占空间
  • 原文地址:https://www.cnblogs.com/onephp/p/5527442.html
Copyright © 2020-2023  润新知