当前位置: 首页>>代码示例>>PHP>>正文


PHP Html::icon方法代码示例

本文整理汇总了PHP中yii\bootstrap\Html::icon方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::icon方法的具体用法?PHP Html::icon怎么用?PHP Html::icon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\bootstrap\Html的用法示例。


在下文中一共展示了Html::icon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: normalizeItem

 /**
  * @param string|array $item the item to be normalized.
  * @return string|array normalized item.
  */
 protected function normalizeItem($item)
 {
     if (is_array($item)) {
         if (isset($item['icon'])) {
             if (isset($item['label'])) {
                 $label = $item['label'];
                 $encodeLabel = isset($item['encode']) ? $item['encode'] : $this->encodeLabels;
                 if ($encodeLabel) {
                     $label = Html::encode($label);
                 }
             } else {
                 $label = '';
             }
             $item['encode'] = false;
             $label = Html::icon($item['icon']) . ' ' . $label;
             $item['label'] = $label;
         }
         if (isset($item['items'])) {
             foreach ($item['items'] as $key => $value) {
                 $item['items'][$key] = $this->normalizeItem($value);
             }
         }
     }
     return $item;
 }
开发者ID:ASP96,项目名称:admin,代码行数:29,代码来源:Nav.php

示例2: init

 public function init()
 {
     $dir = Yii::getAlias('@vendor/dersonsena/yii2-common-classes/src');
     $this->initI18N($dir, 'common');
     $this->controllerDescription = Yii::t('common', 'NO CONTROLLER DESCRIPTION');
     $this->actionDescription = Yii::t('common', 'NO ACTION DESCRIPTION');
     parent::init();
     Yii::setAlias('@common-classes', '@vendor/dersonsena/yii2-common-classes');
     Yii::$app->params['pagination']['pageSize'] = 25;
     Yii::$app->params['maskMoneyOptions'] = ['prefix' => 'R$ ', 'suffix' => '', 'affixesStay' => true, 'thousands' => '.', 'decimal' => ',', 'precision' => 2, 'allowZero' => false, 'allowNegative' => false];
     Yii::$app->params['defaultAddons'] = ['money' => ['prepend' => ['content' => '<i class="fa fa-money" aria-hidden="true"></i>']], 'url' => ['prepend' => ['content' => 'http://']], 'email' => ['prepend' => ['content' => Html::icon('envelope')]], 'phone' => ['prepend' => ['content' => Html::icon('phone-alt')]], 'date' => ['prepend' => ['content' => Html::icon('calendar')]], 'time' => ['prepend' => ['content' => Html::icon('time')]]];
 }
开发者ID:dersonsena,项目名称:yii2-common-classes,代码行数:12,代码来源:ControllerBase.php

示例3:

<div class="row">
    <div class="col-md-8" ng-app="user">

        <div ng-controller="Feeds">
            <div id="feedForm" class="mb10">
                <form>
                    <div class="feed-form">
                        <div class="feed-content">
                            <div class="form-group">
                                <textarea ng-model="feed.content" name="content" placeholder="发动态?有问题?什么可以发在这里" id="feedContent" rows="4"></textarea>
                            </div>
                            <div id="feed-images-preview" class="form-group">
                                <div class="image-box" ng-repeat="image in feed.args.imgs">
                                    <img width="48" height="48" ng-src="{{image.src}}">
                                    <?php 
echo Html::icon('remove', ['class' => 'remove', 'ng-click' => 'deleteImage($index)']);
?>
                                </div>
                            </div>
                        </div>

                        <div id="plus" class="form-group">
                    <span class="btns">
                        <span id="pic" ngf-pattern="'image/*'" ngf-accept="'image/*'" ngf-max-size="20MB"
                              ngf-select="uploadFiles($files)" multiple="multiple">图片</span>
                        <span ng-hide="form.contentLen <= 0">还可以输入<span ng-model="form.contentLen">{{(140-feed.content.length<=0)?0:(140-feed.content.length)}}个字符</span></span>
                        <span ng-show="form.contentLenMore > 0">已经多出<span ng-model="form.contentLenMore">{{feed.contentLenMore}}个字符</span></span>
                    </span>
                            <button class="pull-right" id="feedSubmit" ng-click="postfeed()">发布</button>
                        </div>
                        <div id="info" ng-show="info.isShow">{{info.msg}}</div>
开发者ID:awebc,项目名称:web_xbf,代码行数:31,代码来源:index.php

示例4: _generateGalleryTemplateByPath

 /**
  * Function gen template one image by path
  * @param $imgPath Path of image
  * @param $imgPathFull Path full of image
  * @return string
  */
 private static function _generateGalleryTemplateByPath($imgPath, $imgPathFull)
 {
     $template = Html::beginTag('div', ['class' => 'col-md-3 col-lg-3 text-center']);
     $template .= Html::icon('ok', ['class' => 'icon-active sya_remove_img', 'onclick' => 'removeImageByGallery($(this).next());']);
     $infomation_images = Json::encode(['url' => $imgPath, 'title' => reset(explode('.', end(explode('/', $imgPath)))), 'caption' => '', 'alt_text' => '']);
     // View image
     $template .= Html::beginTag('div', ['class' => 'letImgPreview', 'id' => $imgPath, 'data-info' => $infomation_images, 'onclick' => 'syaPreviewImage(this);']);
     $template .= Html::img('@web/' . $imgPathFull, ['style' => 'max-width: 100%;']);
     $template .= Html::endTag('div');
     $template .= Html::endTag('div');
     return $template;
 }
开发者ID:sya0710,项目名称:yii2-gallery,代码行数:18,代码来源:Gallery.php

示例5:

                    <?php 
echo $form->field($model, 'rememberMe')->checkbox();
?>
                </div>
                <div class="col-xs-4">
                    <?php 
echo Html::submitButton('Login ' . Html::icon('log-in'), ['class' => 'btn btn-primary btn-block btn-flat', 'name' => 'login-button']);
?>
                </div>
            </div>

        <?php 
ActiveForm::end();
?>

        <div class="row">
            <div class="col-xs-12 col-md-12"><hr/></div>
        </div>

        <?php 
echo Html::a(Html::icon('chevron-right') . ' Esqueceu sua senha? Clique aqui!', ['forgot']);
?>
    </div>

    <small class="text-center" style="margin-top: 20px; display: block;">
        <?php 
echo $this->render('/partials/login-footer');
?>
    </small>
</div>
开发者ID:dersonsena,项目名称:yii2-user-module,代码行数:30,代码来源:index.php

示例6:

?>
</p>

        <table class="table table-bordered table-striped">
            <tbody>
            <?php 
foreach ($rows as $row) {
    ?>
                <tr>
                    <td>
                        <b><?php 
    echo $row['title'];
    ?>
</b><br>
                        <?php 
    echo $row['description'];
    ?>
                    </td>
                    <td style="text-align: center; vertical-align: middle;">
                        <?php 
    echo Html::a(Html::icon($row['icon']) . ' ' . $row['title'], $row['url'], $row['options']);
    ?>
                    </td>
                </tr>
            <?php 
}
?>
            </tbody>
        </table>
    </div>
</div>
开发者ID:yii2tech,项目名称:project-template,代码行数:31,代码来源:index.php

示例7: getDefaultButtonOptions

 /**
  * @return array
  */
 public function getDefaultButtonOptions()
 {
     return array_merge(parent::getDefaultButtonOptions(), ['icon' => Html::icon('glyphicon glyphicon-star'), 'label' => Yii::t('vote', 'Add to favorites'), 'labelAdd' => Yii::t('vote', 'Add to favorites'), 'labelRemove' => Yii::t('vote', 'Remove from favorites')]);
 }
开发者ID:hauntd,项目名称:yii2-vote,代码行数:7,代码来源:Favorite.php

示例8:

        </div>
        <div class="row">
            <div class="col-xs-12 col-sm-6 col-md-5">
                <?php 
echo $form->field($model, 'university_id')->dropDownList($universities, ['prompt' => Yii::t('lbl', 'University')])->label(false);
?>
            </div>
            <div class="col-xs-12 col-sm-6 col-md-5">
                <?php 
echo $form->field($model, 'tag_id')->dropDownList($tags, ['prompt' => Yii::t('lbl', 'Interests')])->label(false);
?>
            </div>
            <div class="col-xs-12 col-sm-6 col-md-2">
                <div class="form-group">
                    <?php 
echo Html::submitButton('Szukaj ' . Html::icon('search'), ['class' => 'btn btn-fullwidth btn-orange']);
?>
                </div>
            </div>
        </div>
    </article>
<?php 
ActiveForm::end();
?>

<div class="search-results">
    <?php 
if (is_array($results)) {
    if (empty($results)) {
        echo '<article>' . Yii::t('msg', 'No results') . '</article>';
    } else {
开发者ID:jedzura,项目名称:nzs,代码行数:31,代码来源:search.php

示例9: foreach

 * Time: 07:41
 */
/** @var $this \yii\web\View */
use yii\bootstrap\Html;
use d4rkstar\dbconfig\components\ConfigurationUtils;
use yii\helpers\Inflector;
use yii\bootstrap\Collapse;
$params = Yii::$app->controller->module->config->params;
print Html::beginForm('', 'post', ['class' => 'form-horizontal']);
$this->title = Yii::t('app', 'Configuration');
$this->params['breadcrumbs'][] = $this->title;
$items = [];
$isFirst = true;
print Html::tag('h1', Html::encode($this->title));
if (!Yii::$app->user->isGuest) {
    print '&nbsp;' . Html::tag('small', Html::icon('pencil', ['class' => 'xs']) . Html::a('Manage', \yii\helpers\Url::to('manage')));
}
?>


<?php 
if (count($params) == 0) {
    print Html::tag('h2', Yii::t('app', 'No configuration items.'));
} else {
    print Html::tag('p', Yii::t('app', 'Click on the titles to expand.'));
    foreach ($params as $group => $params) {
        $options = [];
        /*if ($isFirst) {
              $options['class'] = 'in';
              $isFirst = false;
          }*/
开发者ID:d4rkstar,项目名称:yii2-dbconfig,代码行数:31,代码来源:index.php

示例10: function

use choate\coderelease\components\LayerAsset;
use yii\grid\ActionColumn;
use yii\grid\GridView;
use yii\helpers\Html;
LayerAsset::register($this);
echo Html::a('创建部署', ['deploy', 'id' => $id], ['class' => 'btn btn-primary', 'style' => 'margin-bottom:10px']);
echo GridView::widget(['dataProvider' => $dataProvider, 'layout' => "{items}\n{pager}", 'afterRow' => function ($model, $key, $index, $grid) {
    $content = [];
    foreach ($model->taskItem as $task) {
        $content[] = Html::tag('div', $task->title, ['class' => 'task-title']);
    }
    return Html::tag('tr', Html::tag('td', implode("\n", $content), ['colspan' => 4]));
}, 'columns' => ['deploy_version', 'statusName', 'deploy_time:datetime', ['header' => '操作', 'class' => ActionColumn::className(), 'template' => "{rollback}\n{redeploy}\n{test}", 'buttons' => ['rollback' => function ($url, $model) {
    return $model->getIsDeploy() ? Html::a(\yii\bootstrap\Html::icon('share-alt'), $url, ['title' => '回滚', 'class' => 'deploy-rollback']) : '';
}, 'redeploy' => function ($url, $model) {
    return $model->getIsRollback() ? Html::a(\yii\bootstrap\Html::icon('refresh'), $url, ['title' => '重新部署']) : '';
}]]]]);
$this->registerJs(<<<EOF
\$('.deploy-rollback').click(function(){
    var url = \$(this).attr('href');
    layer.confirm('回滚任务?', {icon: 3, title:'提示'}, function(index){
        layer.close(index);
        var loadIndex = layer.load(1);
        \$.get(url, function() {
            layer.msg('回滚成功', {icon: 1, time:1000}, function() {
                location.reload();
            });
        }).fail(function() {
            layer.msg('回滚失败', {icon: 2, time:1000});
        }).always(function() {
            layer.close(loadIndex);
开发者ID:Choate,项目名称:coderelease,代码行数:31,代码来源:index.php

示例11: getMenuItems

 public static function getMenuItems()
 {
     return [['encode' => false, 'label' => \yii\bootstrap\Html::icon('upload') . '&nbsp;&nbsp;' . Yii::t('app', 'Upload'), 'url' => ['/frontend/records/upload']], ['encode' => false, 'label' => \yii\bootstrap\Html::icon('search') . '&nbsp;&nbsp;' . Yii::t('app', 'Search'), 'url' => ['/frontend/records/search']], ['encode' => false, 'label' => \yii\bootstrap\Html::icon('eye-open') . '&nbsp;&nbsp;' . Yii::t('app', 'Review'), 'url' => ['/frontend/records/review']], ['encode' => false, 'label' => \yii\bootstrap\Html::icon('print') . '&nbsp;&nbsp;' . Yii::t('app', 'Print'), 'url' => false, 'options' => ['class' => 'disabled']], ['encode' => false, 'label' => \yii\bootstrap\Html::icon('pencil') . '&nbsp;&nbsp;' . Yii::t('app', 'Update'), 'url' => false, 'options' => ['class' => 'disabled']], ['encode' => false, 'label' => \yii\bootstrap\Html::icon('list-alt') . '&nbsp;&nbsp;' . Yii::t('app', 'Reports'), 'url' => false, 'options' => ['class' => 'disabled']], ['encode' => false, 'label' => \yii\bootstrap\Html::icon('asterisk') . '&nbsp;&nbsp;' . Yii::t('app', 'Settings'), 'url' => false, 'options' => ['class' => 'disabled']]];
 }
开发者ID:vfokov,项目名称:tims2,代码行数:4,代码来源:Module.php

示例12: getDefaultButtonOptions

 /**
  * @return array
  */
 public function getDefaultButtonOptions()
 {
     return array_merge(parent::getDefaultButtonOptions(), ['icon' => Html::icon('glyphicon glyphicon-heart'), 'label' => Yii::t('vote', 'Like')]);
 }
开发者ID:hauntd,项目名称:yii2-vote,代码行数:7,代码来源:Like.php

示例13: getDefaultButtonOptions

 /**
  * @return array
  */
 public function getDefaultButtonOptions()
 {
     return ['class' => 'vote-btn btn btn-default', 'icon' => Html::icon('glyphicon glyphicon-arrow-up'), 'label' => Yii::t('vote', 'Vote up')];
 }
开发者ID:hauntd,项目名称:yii2-vote,代码行数:7,代码来源:VoteToggle.php

示例14:

 */
use yii\helpers\Html;
?>

<div class="favorite">
    <h5><?php 
echo Html::a($model->title, $model->from_url, ['target' => '_blank']);
?>
</h5>
    <div class="color-grey">
        <?php 
echo $model->about;
?>
    </div>
    <div class="color-gey">
        <span class="pull-right">
            <?php 
echo $model->created_at;
?>
        </span>
        <span class="mr10 color-grey">
            <?php 
echo \yii\bootstrap\Html::icon('remove');
?>
            <?php 
echo Html::a("删除", ['/api/favorite/delete', 'id' => $model->id], ['data-method' => 'POST']);
?>
        </span>
    </div>
</div>
开发者ID:awebc,项目名称:web_xbf,代码行数:30,代码来源:_view.php

示例15:

?>

    <?php 
echo $form->field($model, 'name')->textInput();
?>

    <?php 
echo $form->field($model, 'url')->widget(\sibds\widgets\translitInput::className(), ['fromField' => 'name']);
?>

    <?php 
echo $form->field($model, 'image')->widget(\sibds\widgets\InputFile::className());
?>

    <?php 
echo $form->field($model, 'layout')->widget(\kartik\select2\Select2::className(), ['data' => Yii::$app->controller->getLayouts(), 'options' => ['placeholder' => 'Значение по умолчанию'], 'addon' => ['prepend' => ['content' => \yii\bootstrap\Html::icon('open-file')]]]);
?>

    <?php 
echo $form->field($model, 'description')->widget(\sibds\widgets\CKEditor::className(), ['options' => ['rows' => 6]]);
?>

    <?php 
echo \sibds\form\FormFooter::widget(['model' => $model]);
?>

    <?php 
ActiveForm::end();
?>

</div>
开发者ID:sibds,项目名称:playground,代码行数:31,代码来源:_form.php


注:本文中的yii\bootstrap\Html::icon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。