本文整理汇总了PHP中rmrevin\yii\fontawesome\FA::icon方法的典型用法代码示例。如果您正苦于以下问题:PHP FA::icon方法的具体用法?PHP FA::icon怎么用?PHP FA::icon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rmrevin\yii\fontawesome\FA
的用法示例。
在下文中一共展示了FA::icon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
/**
* Lists all StaticPageTable models.
* @return mixed
*/
public function actionIndex()
{
if (!Yii::$app->user->can('static-page-table/index')) {
Yii::$app->session->setFlash('error', 'Нет доступа!');
return $this->redirect('/');
}
if (isset($_POST['sort_list_2'])) {
$mas = explode(',', $_POST['sort_list_2']);
for ($i = 0; $i <= sizeof($mas) - 1; $i++) {
$model = $this->findModel($mas[$i]);
$model->position = $i;
$model->save();
}
}
$staticPagesTrue = StaticPageTable::find()->where(['status' => 1])->orderBy(['position' => SORT_ASC])->all();
$staticPagesFalse = StaticPageTable::find()->where(['status' => 0])->orderBy(['position' => SORT_ASC])->all();
$list = [];
$value = "";
foreach ($staticPagesTrue as $statispage) {
$list[$statispage->id] = ['content' => Html::a(FA::icon($statispage->icon) . " " . $statispage->name, ['view', 'url' => $statispage->url])];
$value .= $statispage->id . ",";
}
foreach ($staticPagesFalse as $statispage) {
$list[$statispage->id] = ['content' => Html::a(FA::icon($statispage->icon) . " " . $statispage->name, ['view', 'url' => $statispage->url]), 'disabled' => true];
$value .= $statispage->id . ",";
}
$value = substr($value, 0, -1);
return $this->render('index', ['list' => $list, 'value' => $value]);
}
示例2: init
/**
* @inheritdoc
*/
public function init()
{
parent::init();
Html::addCssClass($this->options, ['widget' => 'info-box']);
$iconOptions = ['class' => 'info-box-icon'];
if ($this->type === self::COLORED_ICON) {
Html::addCssClass($iconOptions, 'bg-' . $this->color);
} else {
Html::addCssClass($this->options, 'bg-' . $this->color);
}
echo Html::beginTag('div', $this->options);
echo Html::tag('span', FA::icon($this->icon), $iconOptions);
echo '<div class="info-box-content">';
if (!empty($this->contents)) {
foreach ($this->contents as $content) {
if (is_array($content)) {
$type = ArrayHelper::getValue($content, 'type', 'text');
$text = ArrayHelper::getValue($content, 'text', '');
if (in_array($type, ['text', 'number'])) {
echo Html::tag('span', $text, ['class' => 'info-box-' . $type]);
} elseif ($type == 'progress') {
$value = ArrayHelper::getValue($content, 'value', $text);
echo '<div class="progress">';
echo Html::tag('div', '', ['class' => 'progress-bar', 'style' => ['width' => $value . '%']]);
echo '</div>';
} else {
echo Html::tag('span', $text, ['class' => $type]);
}
} else {
echo $content;
}
}
}
}
示例3: createLabel
/**
* Creates the label for a button
*
* @return string the label
*/
protected function createLabel()
{
$icon = empty($this->icon) ? '' : FA::icon($this->icon);
if (empty($this->label) || strcmp($this->label, 'Button') === 0) {
$label = '';
} else {
$label = Html::tag('span', $this->encodeLabel ? Html::encode($this->label) : $this->label);
}
return $icon . $label;
}
示例4: renderItem
/**
* @param array|string $item
* @return null|string
*/
function renderItem($item)
{
$options = [];
if (isset($item['visible']) && $item['visible'] !== true) {
return null;
}
$anchor_options = [];
if (!isset($item['items']) || empty($item['items'])) {
$label = '';
$subitems = '';
if (isset($item['icon']) && !empty($item['icon'])) {
$label .= $item['icon'] . ' ';
}
$label .= Html::tag('span', $item['label']);
if (isset($item['badge'])) {
if (!is_array($item['badge'])) {
$item['badge'] = ['text' => $item['badge']];
}
$opt = ['class' => 'label pull-right'];
if (isset($item['badge']['class'])) {
Html::addCssClass($opt, $item['badge']['class']);
}
$label .= ' ' . Html::tag('small', $item['badge']['text'], $opt);
}
} else {
$label = '';
$subitems = '';
if (isset($item['icon']) && !empty($item['icon'])) {
$label .= $item['icon'] . ' ';
}
$label .= Html::tag('span', $item['label']) . FA::icon('angle-left')->pullRight();
foreach ($item['items'] as $subitem) {
$subitems .= renderItem($subitem);
}
$opt = ['class' => 'treeview-menu'];
if (true === $item['selected']) {
Html::addCssClass($opt, 'menu-open');
}
$subitems = Html::tag('ul', $subitems, $opt);
Html::addCssClass($options, 'treeview');
}
if (true === $item['selected']) {
Html::addCssClass($options, 'active');
}
return Html::tag('li', Html::a($label, $item['url'], $anchor_options) . $subitems, $options);
}
示例5: getMenuItems
public function getMenuItems()
{
return [['label' => ($this->_model ? FA::icon(FA::_EDIT) : FA::icon(FA::_PLUS_SQUARE)) . ' <b>' . $this->generateKey() . '</b> <span class="label label-danger">HTML</span>', 'url' => $this->_model ? $this->generateEditRoute($this->_model->id) : $this->generateCreateRoute()]];
}
示例6:
<div class="col-lg-3">
<h2><?php
echo FA::icon('youtube-play');
?>
Видео</h2>
<p>Вставка видео на главной странице и описания к нему</p>
<p><a class="btn btn-primary" href="<?php
echo Url::to(['/admin/video']);
?>
">Начать »</a></p>
</div>
<div class="col-lg-3">
<h2><?php
echo FA::icon('floppy-o');
?>
Релизы</h2>
<p>Добавление и редактирование вышедших релизов для отображения на странице /releases</p>
<p><a class="btn btn-primary" href="<?php
echo Url::to(['/admin/release']);
?>
">Начать »</a></p>
</div>
</div>
</div>
</div>
示例7:
echo $this->render('_general_content', ['ActiveForm' => $ActiveForm, 'PageEditForm' => $PageEditForm]);
?>
</uib-tab>
<uib-tab heading="Meta">
<?php
echo $this->render('_general_meta', ['ActiveForm' => $ActiveForm, 'PageEditForm' => $PageEditForm]);
?>
</uib-tab>
</uib-tabset>
<?php
?>
</div>
</div>
</div>
<div class="box-footer">
<?php
echo Html::submitButton(FA::icon('check') . ' ' . Yii::t('cookyii', 'Save'), ['class' => 'btn btn-success', 'ng-disabled' => 'in_progress']);
echo Html::button(Yii::t('cookyii', 'Cancel'), ['class' => 'btn btn-link', 'ng-click' => 'reload()']);
?>
</div>
<div class="overlay" ng-if="inProgress">
<?php
echo FA::icon('cog')->spin();
?>
</div>
</div>
<?php
ActiveForm::end();
示例8: testIconFlipException
public function testIconFlipException()
{
$this->setExpectedException('yii\\base\\InvalidConfigException', 'FA::flip() - invalid value. Use one of the constants: FA::FLIP_HORIZONTAL, FA::FLIP_VERTICAL.');
FA::icon('cog')->flip('badvalue');
}
示例9: menu
/**
* @inheritdoc
*/
public function menu($Controller)
{
return [['label' => \Yii::t('cookyii.account', 'Accounts'), 'url' => ['/account/list/index'], 'icon' => FA::icon('user'), 'visible' => User()->can(Account\backend\Permissions::ACCESS), 'selected' => $Controller->module->id === 'account', 'sort' => 10000]];
}
示例10: renderItem
/**
* Renders a widget's item.
* @param string|array $item the item to render.
* @return string the rendering result.
* @throws InvalidConfigException
*/
public function renderItem($item)
{
if (is_string($item)) {
return $item;
}
if (!isset($item['label']) && !isset($item['icon'])) {
throw new InvalidConfigException("The 'label' option is required.");
}
$encodeLabel = isset($item['encode']) ? $item['encode'] : $this->encodeLabels;
$label = ArrayHelper::getValue($item, 'label', '');
if ($encodeLabel) {
$label = Html::encode($label);
}
$icon = ArrayHelper::getValue($item, 'icon');
if ($icon) {
$label = FA::icon($icon) . ' ' . $label;
}
$badge = ArrayHelper::getValue($item, 'badge');
if (!empty($badge)) {
$badgeColor = ArrayHelper::getValue($item, 'badgeColor', 'red');
$label .= ' ' . Html::tag('small', $badge, ['class' => 'badge pull-right bg-' . $badgeColor]);
}
$options = ArrayHelper::getValue($item, 'options', []);
$items = ArrayHelper::getValue($item, 'items');
$url = ArrayHelper::getValue($item, 'url', '#');
$linkOptions = ArrayHelper::getValue($item, 'linkOptions', []);
if (isset($item['active'])) {
$active = ArrayHelper::remove($item, 'active', false);
} else {
$active = $this->isItemActive($item);
}
if ($items !== null) {
Html::addCssClass($options, ['widget' => 'treeview']);
if ($this->treeviewCaret !== '') {
$label .= ' ' . $this->treeviewCaret;
}
if (is_array($items)) {
if ($this->activateItems) {
$items = $this->isChildActive($items, $active);
}
$items = $this->renderItems($items, ['class' => 'treeview-menu']);
}
}
if ($this->activateItems && $active) {
Html::addCssClass($options, 'active');
}
return Html::tag('li', Html::a($label, $url, $linkOptions) . $items, $options);
}
示例11:
</script>
<script type="text/ng-template" id="toast-warning.html">
<md-toast class="warning">
<span flex>
<?php
echo FA::icon('exclamation-triangle')->fixedWidth();
?>
<strong ng-show="false">{{ message.title }}<br></strong>
<span>{{ message.text }}</span>
</span>
<md-button ng-click="resolve()" class="md-action">
{{ action }}
</md-button>
</md-toast>
</script>
<script type="text/ng-template" id="toast-danger.html">
<md-toast class="danger">
<span flex>
<?php
echo FA::icon('times')->fixedWidth();
?>
<strong ng-show="false">{{ message.title }}<br></strong>
<span>{{ message.text }}</span>
</span>
<md-button ng-click="resolve()" class="md-action">
{{ action }}
</md-button>
</md-toast>
</script>
示例12:
?>
</span>
<div class="info-box-content">
<strong class="info-box-text"><?php
echo Yii::t('cookyii', 'Warning');
?>
</strong>
<span class="progress-description">
<?php
echo Yii::t('cookyii', 'The data of this item has been changed.');
?>
<br>
<?php
echo Yii::t('cookyii', 'Recommended {refresh} the page.', ['refresh' => Html::a(FA::icon('refresh') . ' ' . Yii::t('cookyii', 'Refresh'), null, ['class' => 'btn btn-danger btn-xs', 'ng-click' => 'reload()'])]);
?>
</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<?php
echo $this->render('_general', ['PageEditForm' => $PageEditForm]);
?>
</div>
</div>
</section>
示例13:
* @link https://rmrevin.com
*/
use rmrevin\yii\fontawesome\FA;
?>
<script type="text/ng-template" id="directives/progressbar/progressbar.html">
<div class="toast-progress"></div>
</script>
<script type="text/ng-template" id="directives/toast/toast.html">
<div class="{{ toastClass }} {{ toastType }} wo-animate animated flipInX" ng-click="tapToast()">
<div class="icon">
<div ng-switch on="toastType">
<?php
echo FA::icon('times', ['ng-switch-when' => 'error'])->fixedWidth();
echo FA::icon('exclamation-triangle', ['ng-switch-when' => 'warning'])->fixedWidth();
echo FA::icon('check', ['ng-switch-when' => 'success'])->fixedWidth();
echo FA::icon('info', ['ng-switch-when' => 'info'])->fixedWidth();
?>
</div>
</div>
<div class="body" ng-switch on="allowHtml">
<div ng-switch-default ng-if="title" class="{{ titleClass }}" aria-label="{{ title }}" ng-bind="title"></div>
<div ng-switch-default class="{{ messageClass }}" aria-label="{{ message }}" ng-bind="message"></div>
<div ng-switch-when="true" ng-if="title" class="{{ titleClass }}" ng-bind-html="title"></div>
<div ng-switch-when="true" class="{{ messageClass }}" ng-bind-html="message"></div>
</div>
<progress-bar ng-if="progressBar"></progress-bar>
</div>
</script>
示例14:
}
?>
<?php
foreach ($properties as $i => $property) {
?>
<div class="item panel panel-default"><!-- widgetItem -->
<div class="panel-heading">
<h3 class="panel-title pull-left">Характеристика <?php
echo $i + 1;
?>
</h3>
<div class="pull-right">
<button type="button" class="remove-item btn btn-danger btn-xs">
<?php
echo FA::icon('minus');
?>
Удалить
</button>
</div>
<div class="clearfix"></div>
</div>
<div class="panel-body">
<?php
// necessary for update action.
if (!$property->isNewRecord) {
echo Html::activeHiddenInput($property, "[{$i}]id");
}
?>
<?php
echo $form->field($property, "[{$i}]name")->textInput(['maxlength' => true]);
示例15: renderItem
/**
* Renders a widget's item.
* @param string|array $item the item to render.
* @return string the rendering result.
* @throws InvalidConfigException
*/
public function renderItem($item)
{
if (is_string($item)) {
return $item;
}
if (!isset($item['label']) && !isset($item['icon'])) {
throw new InvalidConfigException("The 'label' option is required.");
}
$encodeLabel = isset($item['encode']) ? $item['encode'] : $this->encodeLabels;
$label = ArrayHelper::getValue($item, 'label', '');
if ($encodeLabel) {
$label = Html::encode($label);
}
$icon = ArrayHelper::getValue($item, 'icon');
if ($icon) {
$label .= ' ' . FA::icon($icon);
}
$badge = ArrayHelper::getValue($item, 'badge');
if (!empty($badge)) {
if (is_array($badge)) {
$badgeValue = ArrayHelper::getValue($badge, 'value');
$badgeType = ArrayHelper::getValue($badge, 'type');
$label .= ' ' . Html::tag('span', $badgeValue, ['class' => 'label label-' . $badgeType]);
} else {
$label .= ' ' . $badge;
}
}
$options = ArrayHelper::getValue($item, 'options', []);
$items = ArrayHelper::getValue($item, 'items');
$url = ArrayHelper::getValue($item, 'url', '#');
$linkOptions = ArrayHelper::getValue($item, 'linkOptions', []);
if (isset($item['active'])) {
$active = ArrayHelper::remove($item, 'active', false);
} else {
$active = $this->isItemActive($item);
}
if ($items !== null) {
$linkOptions['data-toggle'] = 'dropdown';
Html::addCssClass($options, ['widget' => 'dropdown']);
Html::addCssClass($linkOptions, ['widget' => 'dropdown-toggle']);
if ($this->dropDownCaret !== '') {
$label .= ' ' . $this->dropDownCaret;
}
if (is_array($items)) {
if ($this->activateItems) {
$items = $this->isChildActive($items, $active);
}
$items = $this->renderDropdown($items, $item);
}
}
if ($this->activateItems && $active) {
Html::addCssClass($options, 'active');
}
return Html::tag('li', Html::a($label, $url, $linkOptions) . $items, $options);
}