本文整理汇总了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;
}
示例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')]]];
}
示例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>
示例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;
}
示例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>
示例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>
示例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')]);
}
示例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 {
示例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 ' ' . 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;
}*/
示例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);
示例11: getMenuItems
public static function getMenuItems()
{
return [['encode' => false, 'label' => \yii\bootstrap\Html::icon('upload') . ' ' . Yii::t('app', 'Upload'), 'url' => ['/frontend/records/upload']], ['encode' => false, 'label' => \yii\bootstrap\Html::icon('search') . ' ' . Yii::t('app', 'Search'), 'url' => ['/frontend/records/search']], ['encode' => false, 'label' => \yii\bootstrap\Html::icon('eye-open') . ' ' . Yii::t('app', 'Review'), 'url' => ['/frontend/records/review']], ['encode' => false, 'label' => \yii\bootstrap\Html::icon('print') . ' ' . Yii::t('app', 'Print'), 'url' => false, 'options' => ['class' => 'disabled']], ['encode' => false, 'label' => \yii\bootstrap\Html::icon('pencil') . ' ' . Yii::t('app', 'Update'), 'url' => false, 'options' => ['class' => 'disabled']], ['encode' => false, 'label' => \yii\bootstrap\Html::icon('list-alt') . ' ' . Yii::t('app', 'Reports'), 'url' => false, 'options' => ['class' => 'disabled']], ['encode' => false, 'label' => \yii\bootstrap\Html::icon('asterisk') . ' ' . Yii::t('app', 'Settings'), 'url' => false, 'options' => ['class' => 'disabled']]];
}
示例12: getDefaultButtonOptions
/**
* @return array
*/
public function getDefaultButtonOptions()
{
return array_merge(parent::getDefaultButtonOptions(), ['icon' => Html::icon('glyphicon glyphicon-heart'), 'label' => Yii::t('vote', 'Like')]);
}
示例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')];
}
示例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>
示例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>