本文整理汇总了PHP中kartik\icons\Icon类的典型用法代码示例。如果您正苦于以下问题:PHP Icon类的具体用法?PHP Icon怎么用?PHP Icon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Icon类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: saveButtons
/**
* @param ActiveRecord $model Model instance
* @param string $indexAction Route path to index action
* @return string Rendered save buttons with redurectUrl!
*/
public static function saveButtons(ActiveRecord $model, $indexAction = 'index', $buttonClass = 'btn-sm', $onlySaveAndBack = false)
{
$result = '<div class="form-group no-margin btn-group">';
if ($onlySaveAndBack === false) {
$result .= Html::a(Icon::show('arrow-circle-left') . Yii::t('app', 'Back'), Yii::$app->request->get('returnUrl', [$indexAction, 'id' => $model->id]), ['class' => 'btn btn-default ' . $buttonClass]);
}
if ($model->isNewRecord && $onlySaveAndBack === false) {
$result .= Html::submitButton(Icon::show('save') . Yii::t('app', 'Save & Go next'), ['class' => 'btn btn-success ' . $buttonClass, 'name' => 'action', 'value' => 'next']);
}
$result .= Html::submitButton(Icon::show('save') . Yii::t('app', 'Save & Go back'), ['class' => 'btn btn-warning ' . $buttonClass, 'name' => 'action', 'value' => 'back']);
if ($onlySaveAndBack === false) {
$result .= Html::submitButton(Icon::show('save') . Yii::t('app', 'Save'), ['class' => 'btn btn-primary ' . $buttonClass, 'name' => 'action', 'value' => 'save']);
}
$result .= '</div>';
return $result;
}
开发者ID:lzpfmh,项目名称:dotplant2,代码行数:21,代码来源:Helper.php
示例2: run
public function run()
{
Icon::map($this->view, Icon::FA);
echo "<div id='cjModalContent'>" . Icon::show('refresh fa-spin', [], Icon::FA) . "</div>";
// echo "".Icon::show('refresh fa-spin', [], Icon::FA)."";
parent::run();
}
开发者ID:claudejanz,项目名称:yii2-toolbox,代码行数:7,代码来源:AjaxModal.php
示例3: getActions
public function getActions()
{
$actions = is_null($this->actions) ? $this->_actions : array_intersect_key($this->_actions, $this->actions);
$ret_val = '';
foreach ($actions as $name => $action) {
switch (isset($action['adminOnly']) && $action['adminOnly'] == true) {
case true:
switch (\Yii::$app->userMeta->isAdmin()) {
case true:
$action['options']['id'] = $action['options']['id'] . $this->parentId;
$ret_val[$name] = function ($url, $model) use($action) {
return Html::a(Icon::show($action['text']), $action['action'] . '/' . $model->getId(), $action['options']);
};
break;
}
break;
default:
$action['options']['id'] = $action['options']['id'] . $this->parentId;
$ret_val[$name] = function ($url, $model) use($action) {
return Html::a(Icon::show($action['text']), $action['action'] . '/' . $model->getId(), $action['options']);
};
break;
}
}
return $ret_val;
}
开发者ID:nhatvuvan,项目名称:yii2-widgets,代码行数:26,代码来源:Revisions.php
示例4: run
public function run()
{
echo Html::beginTag('div', ['class' => 'input-group']);
if (!isset($this->options['class'])) {
$this->options['class'] = 'form-control';
}
$iconId = 'icon-' . $this->options['id'];
if (!isset($this->options['aria-describedby'])) {
$this->options['aria-describedby'] = $iconId;
}
if ($this->hasModel()) {
$replace['{input}'] = Html::activeTextInput($this->model, $this->attribute, $this->options);
} else {
$replace['{input}'] = Html::textInput($this->name, $this->value, $this->options);
}
if ($this->icon != '') {
$replace['{icon}'] = Html::tag('span', Icon::show($this->icon, [], Icon::FA), ['class' => 'input-group-addon', 'id' => $iconId]);
}
echo strtr($this->template, $replace);
echo Html::endTag('div');
$view = $this->getView();
Assets::register($view);
$idMaster = $this->hasModel() ? Html::getInputId($this->model, $this->fromField) : $this->fromField;
$idSlave = $this->options['id'];
$view->registerJs("\n \$('#{$idMaster}').syncTranslit({\n destination: '{$idSlave}',\n type: 'url',\n caseStyle: 'lower',\n urlSeparator: '-'\n });");
}
开发者ID:sibds,项目名称:yii2-synctranslit,代码行数:26,代码来源:translitInput.php
示例5: init
public function init()
{
if (is_array($this->copyFrom)) {
$id = Html::getInputId($this->model, $this->attribute);
$buttonId = $id . '-copyButton';
$this->addon['append'] = ['content' => Html::button(Icon::show('code'), ['class' => 'btn btn-primary', 'id' => $buttonId]), 'asButton' => true];
$encodedFrom = Json::encode($this->copyFrom);
$encodedTo = Json::encode('#' . $id);
$js = <<<EOT
\$("#{$buttonId}").click(function(){
Admin.copyFrom(
{$encodedFrom},
{$encodedTo}
);
});
EOT;
$this->form->getView()->registerJs($js);
} elseif (is_array($this->makeSlug)) {
$id = Html::getInputId($this->model, $this->attribute);
$buttonId = $id . '-slugButton';
$this->addon['append'] = ['content' => Html::button(Icon::show('code'), ['class' => 'btn btn-primary', 'id' => $buttonId]), 'asButton' => true];
$encodedFrom = Json::encode($this->makeSlug);
$encodedTo = Json::encode('#' . $id);
$js = <<<EOT
\$("#{$buttonId}").click(function(){
Admin.makeSlug(
{$encodedFrom},
{$encodedTo}
);
});
EOT;
$this->form->getView()->registerJs($js);
}
parent::init();
}
开发者ID:heartshare,项目名称:dotplant2,代码行数:35,代码来源:ActiveField.php
示例6: run
public function run()
{
$this->genButton = Html::a(Icon::show('edit') . Yii::t('app', 'Generate'), '#', ['class' => 'btn btn-success', 'id' => 'btn-generate']);
$parent_id = $this->model->main_category_id;
$owner_id = $this->model->id;
$this->addButton = Html::a(Icon::show('plus') . Yii::t('app', 'Add'), Url::toRoute(['/shop/backend-product/edit', 'parent_id' => $parent_id, 'owner_id' => $owner_id, 'returnUrl' => \app\backend\components\Helper::getReturnUrl()]), ['class' => 'btn btn-success', 'id' => 'btn-add']);
if (!empty($this->footer)) {
$this->footer = Html::tag('div', $this->addButton . ' ' . $this->genButton, ['class' => 'widget-footer']);
}
$this->object = Object::getForClass(get_class($this->model));
$rest_pg = (new Query())->select('id, name')->from(PropertyGroup::tableName())->where(['object_id' => $this->object->id])->orderBy('sort_order')->all();
$this->property_groups_to_add = [];
foreach ($rest_pg as $row) {
$this->property_groups_to_add[$row['id']] = $row['name'];
}
$optionGenerate = Json::decode($this->model->option_generate);
if (null === PropertyGroup::findOne($optionGenerate['group'])) {
$this->model->option_generate = $optionGenerate = null;
}
$groupModel = null;
if (isset($optionGenerate['group'])) {
$groupModel = PropertyGroup::findOne($optionGenerate['group']);
$properties = Property::getForGroupId($optionGenerate['group']);
} else {
$group_ids = array_keys($this->property_groups_to_add);
$group_id = array_shift($group_ids);
$groupModel = PropertyGroup::findOne($group_id);
$properties = Property::getForGroupId($group_id);
}
if (is_null($groupModel)) {
$groupModel = new PropertyGroup();
}
return $this->render($this->viewFile, ['model' => $this->model, 'form' => $this->form, 'groups' => $this->property_groups_to_add, 'groupModel' => $groupModel, 'properties' => $properties, 'optionGenerate' => $optionGenerate, 'footer' => $this->footer]);
}
开发者ID:tqsq2005,项目名称:dotplant2,代码行数:34,代码来源:OptionGenerate.php
示例7: run
/**
* Renders the menu.
*/
public function run()
{
// Get Module list
$modules = array_keys(Yii::$app->modules);
// Get sub menu for each module
foreach ($modules as $moduleName) {
// Get module
$moduleObj = Yii::$app->getModule($moduleName);
$iconClass = isset($moduleObj->iconClass) ? $moduleObj->iconClass : 'fa-dashboard';
// Get menu
if (property_exists($moduleObj, 'backendMenu')) {
$getModule = Yii::$app->request->get('module');
$item = ['label' => Icon::show($iconClass) . '<span class="nav-label">' . Yii::t($moduleName, ucfirst($moduleName)) . '</span>', 'url' => ['/' . $moduleName . '/default']];
if (Yii::$app->controller->module->id == $moduleName and empty($getModule) or $getModule == $moduleName) {
$item['active'] = TRUE;
}
$backendMenu = $moduleObj->backendMenu;
if (is_array($backendMenu)) {
foreach ($backendMenu as $itemMenu) {
if (isset($itemMenu['access']) and $this->checkAccess($itemMenu['access'])) {
$item['items'][] = ['label' => $itemMenu['label'], 'url' => $itemMenu['url']];
}
}
if (isset($item['items']) and !empty($item['items'])) {
$item['label'] .= '<span class="fa arrow"></span>';
}
}
// assign to $this->items
$this->items[] = $item;
}
}
parent::run();
}
开发者ID:quynhvv,项目名称:stepup,代码行数:36,代码来源:BackendMenu.php
示例8: initDefaultButtons
/**
* Initializes the default button rendering callbacks.
*/
protected function initDefaultButtons()
{
/* TODO: Add support!
if (!isset($this->buttons['view'])) {
$this->buttons['view'] = function ($url, $model, $key) {
$options = array_merge([
'title' => self::t('yii', 'View'),
'aria-label' => self::t('yii', 'View'),
'data-pjax' => '0',
], $this->buttonOptions);
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, $options);
};
}
*/
if (!isset($this->buttons['update'])) {
$this->buttons['update'] = function ($url, $model, $key) {
$options = array_merge(['title' => self::t('messages', 'Edit'), 'aria-label' => self::t('messages', 'Edit'), 'data-pjax' => '0'], $this->buttonOptions);
return Html::a(trim(Icon::show('pencil')), $url, $options);
};
}
if (!isset($this->buttons['copy'])) {
$this->buttons['copy'] = function ($url, $model, $key) {
$options = array_merge(['title' => self::t('messages', 'Copy'), 'aria-label' => self::t('messages', 'Copy')], $this->buttonOptions);
if ($model->hasMethod('duplicate') && ($model->hasAttribute('removed') && !$model->removed)) {
return Html::a(trim(Icon::show('copy')), $url, $options);
}
};
}
if (!isset($this->buttons['lock'])) {
$this->buttons['lock'] = function ($url, $model, $key) {
$options = array_merge(['title' => self::t('messages', 'Lock'), 'aria-label' => self::t('messages', 'Lock')], $this->buttonOptions);
if ($model->hasAttribute('locked') && !$model->locked && ($model->hasAttribute('removed') && !$model->removed)) {
return Html::a(trim(Icon::show('lock')), $url, $options);
}
};
}
if (!isset($this->buttons['unlock'])) {
$this->buttons['unlock'] = function ($url, $model, $key) {
$options = array_merge(['title' => self::t('messages', 'Unlock'), 'aria-label' => self::t('messages', 'Unlock')], $this->buttonOptions);
if ($model->hasAttribute('locked') && $model->locked && ($model->hasAttribute('removed') && !$model->removed)) {
return Html::a(trim(Icon::show('unlock')), $url, $options);
}
};
}
if (!isset($this->buttons['restore'])) {
$this->buttons['restore'] = function ($url, $model, $key) {
$options = array_merge(['title' => self::t('messages', 'Restore'), 'aria-label' => self::t('messages', 'Restore'), 'data-confirm' => self::t('messages', 'Are you sure you want to restore this item?'), 'data-method' => 'post', 'data-pjax' => '0'], $this->buttonOptions);
if ($model->hasAttribute('removed') && $model->removed) {
return Html::a(trim(Icon::show('share-square-o')), $url, $options);
}
};
}
if (!isset($this->buttons['delete'])) {
$this->buttons['delete'] = function ($url, $model, $key) {
$name = $model->hasAttribute('removed') && !$model->removed ? self::t('messages', 'To trash') : self::t('messages', 'Delete');
$options = array_merge(['title' => $name, 'aria-label' => $name, 'data-confirm' => self::t('messages', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0'], $this->buttonOptions);
return Html::a(trim(Icon::show('trash')), $url, $options);
};
}
}
开发者ID:sibds,项目名称:yii2-gridhelper,代码行数:63,代码来源:ActionColumn.php
示例9: renderButtons
/**
* @return string
*/
protected function renderButtons()
{
$buttons = [self::ADD_ACTION => Html::button(Icon::show('plus') . ' ' . Yii::t('app', 'Add selected to:'), ['class' => isset($this->htmlOptions['add-class']) ? $this->htmlOptions['add-class'] : 'btn btn-default', 'disabled' => 'disabled', 'data-mc-action' => self::ADD_ACTION]), self::MOVE_ACTION => Html::button(Icon::show('arrows') . ' ' . Yii::t('app', 'Move selected to:'), ['class' => isset($this->htmlOptions['move-class']) ? $this->htmlOptions['move-class'] : 'btn btn-default', 'disabled' => 'disabled', 'data-mc-action' => self::MOVE_ACTION])];
$group = '';
foreach ($buttons as $id => $button) {
$group .= Html::tag('div', Html::tag('div', $button . "\n\t" . Html::tag('div', Html::dropDownList(null, null, static::$categories, ['prompt' => Yii::t('app', 'Select category'), 'class' => 'form-control', 'id' => $id]), ['class' => 'input-group']), ['class' => 'btn-group']), ['class' => 'col-xs-12 col-sm-6']);
}
return Html::tag('div', $group, ['class' => 'row m-bottom-10']);
}
开发者ID:lzpfmh,项目名称:dotplant2,代码行数:12,代码来源:CategoryMovementsButtons.php
示例10: init
public function init()
{
$this->registerTranslations();
if (!is_null($this->autoQuery)) {
$auto = $this->autoQuery->roots();
if ($this->rootable) {
$this->query = $auto;
} else {
$this->query = $auto->one() ? $auto->one()->children(1) : null;
}
}
if (is_null($this->modelOptions)) {
$this->modelOptions = ['name' => function ($data) {
return $this->prepareRow($data);
}];
}
if (count($this->columns) == 1 && !$this->hideButtons) {
$this->columns['url'] = function ($data) {
return Url::toRoute([$this->driveController . 'update', 'id' => $data->primaryKey]);
};
}
if (is_null($this->buttons)) {
$model = new $this->query->modelClass();
$this->buttons = [['label' => Icon::show('pencil', [], Icon::FA), 'url' => function ($data) {
return Url::toRoute([$this->driveController . 'update', 'id' => $data->primaryKey]);
}, 'options' => ['title' => self::t('messages', 'Edit'), 'data-pjax' => 0]], ['label' => Icon::show('lock', [], Icon::FA), 'url' => function ($data) {
return Url::toRoute([$this->driveController . 'lock', 'id' => $data->primaryKey]);
}, 'options' => ['title' => self::t('messages', 'Lock'), 'data-method' => 'POST', 'data-pjax' => '0'], 'visible' => function ($data) {
return $data->hasAttribute('locked') && !$data->locked;
}], ['label' => Icon::show('unlock', [], Icon::FA), 'url' => function ($data) {
return Url::toRoute([$this->driveController . 'unlock', 'id' => $data->primaryKey]);
}, 'options' => ['title' => self::t('messages', 'Unlock'), 'data-method' => 'POST', 'data-pjax' => '0'], 'visible' => function ($data) {
return $data->hasAttribute('locked') && $data->locked;
}], ['label' => Icon::show('trash', [], Icon::FA), 'url' => function ($data) {
return Url::toRoute([$this->driveController . 'delete', 'id' => $data->primaryKey]);
}, 'options' => ['title' => self::t('messages', 'To trash'), 'data-method' => 'POST', 'data-pjax' => '0', 'data-confirm' => "Вы действительно хотите удалить этот элемент?"], 'visible' => function ($data) {
return $data->hasAttribute('removed') && !$data->removed;
}], ['label' => Icon::show('share-square-o', [], Icon::FA), 'url' => function ($data) {
return Url::toRoute([$this->driveController . 'restore', 'id' => $data->primaryKey]);
}, 'options' => ['title' => self::t('messages', 'Restore')], 'visible' => function ($data) {
return $data->hasAttribute('removed') && $data->removed;
}], ['label' => Icon::show('remove', [], Icon::FA), 'url' => function ($data) {
return Url::toRoute([$this->driveController . 'delete', 'id' => $data->primaryKey]);
}, 'options' => ['title' => self::t('messages', 'Delete'), 'data-method' => 'POST', 'data-pjax' => '0', 'data-confirm' => "Вы действительно хотите удалить этот элемент?"], 'visible' => function ($data) {
if ($data->hasAttribute('removed')) {
if (is_bool($data->removed)) {
return $data->removed;
}
return !is_null($data->removed);
}
return true;
}]];
}
$this->options['class'] = 'nestable' . (isset($this->options['class']) ? ' ' . $this->options['class'] : '');
parent::init();
}
开发者ID:sibds,项目名称:yii2-nestable,代码行数:56,代码来源:Nestable.php
示例11: run
public function run()
{
$this->options['id'] .= $this->parentId;
$this->options['class'] .= ' ' . ($this->model->count() >= 1 ? 'btn-primary' : 'btn-transparent');
$this->options['label'] = (int) $this->model->count() . ' Issues ' . Icon::show('eye');
$this->options['href'] = \Yii::$app->urlManager->createUrl(['/issue/index/' . $this->parentType . "/" . $this->parentId, '__format' => 'modal', IssuesModel::COMMENT_PARAM => $this->enableComments]);
$this->options['title'] = \Yii::t('yii', 'View Issues');
$info = $this->getInfoLink();
return Html::tag('div', $info, $this->widgetOptions) . $this->getNewIndicator();
}
开发者ID:nhatvuvan,项目名称:yii2-widgets,代码行数:10,代码来源:IssueCount.php
示例12: getUserMenu
public static function getUserMenu()
{
$userItems = [];
if (Yii::$app->user->isGuest) {
$userItems[] = ['label' => Icon::show('sign-in', ['class' => 'fa-fw']) . Yii::t('app', 'Login'), 'url' => ['/site/login']];
} else {
$userItems[] = ['label' => Icon::show('sign-out', ['class' => 'fa-fw']) . Yii::t('app', 'Logout'), 'url' => ['/site/logout'], 'linkOptions' => ['data-method' => 'post']];
}
return $userItems;
}
开发者ID:orcsis,项目名称:yii2-orcsis,代码行数:10,代码来源:Menu.php
示例13: run
public function run()
{
$this->options['id'] .= $this->parentId;
$this->options['class'] .= ' ' . ($this->model->count() >= 1 ? 'btn-primary' : 'btn-transparent');
$this->options['label'] = (int) $this->model->count() . ' Replies ' . Icon::show('eye');
$this->options['href'] = \Yii::$app->urlManager->createUrl(['/reply/index/' . $this->parentType . "/" . $this->parentId]);
$this->options['title'] = \Yii::t('yii', 'View Replies');
$info = $this->getInfoLink($this->model->isWhat());
return Html::tag('div', $info, $this->widgetOptions) . $this->getNewIndicator();
}
开发者ID:nhatvuvan,项目名称:yii2-widgets,代码行数:10,代码来源:RepliesCount.php
示例14: accountMenu
public function accountMenu()
{
if (Yii::$app->user->isGuest) {
$items[] = ['label' => 'Войти', 'url' => ['/site/login']];
$items[] = ['label' => 'Зарегистрироваться', 'url' => ['/site/signup']];
} else {
$user = User::findOne(Yii::$app->user->id);
$items[] = ['label' => $user->username . ' ' . Html::tag('span', preg_replace('/\\,00/', '', number_format($user->money, 2, ',', ' ')) . ' ' . Icon::show('user', ['class' => 'fa-btc'], Icon::FA), ['style' => 'margin: 0 2px 0 6px;']), 'items' => [['label' => 'Добавить лот на продажу', 'url' => ['/tor/mng-ad']], '<li class="divider"></li>', ['label' => 'Сменить пароль', 'url' => ['#']], ['label' => 'Выход', 'url' => ['/site/logout'], 'linkOptions' => ['data-method' => 'post']]]];
}
return $items;
}
开发者ID:mark38,项目名称:yii2-tor,代码行数:11,代码来源:Top.php
示例15: init
public function init()
{
parent::init();
Icon::map(Yii::$app->getView(), Icon::FA);
Icon::map(Yii::$app->getView(), Icon::EL);
Icon::map(Yii::$app->getView(), Icon::TYP);
Icon::map(Yii::$app->getView(), Icon::WHHG);
Icon::map(Yii::$app->getView(), Icon::JUI);
Icon::map(Yii::$app->getView(), Icon::UNI);
Icon::map(Yii::$app->getView(), Icon::SI);
Icon::map(Yii::$app->getView(), Icon::OCT);
Icon::map(Yii::$app->getView(), Icon::FI);
}
开发者ID:pavlinter,项目名称:yii2-adm,代码行数:13,代码来源:AdmAsset.php
示例16: run
public function run()
{
if (!empty($this->footer)) {
$this->footer = Html::tag('div', $this->footer, ['class' => 'widget-footer']);
}
if (!empty($this->icon)) {
$this->title = Icon::show($this->icon) . $this->title;
}
$this->params['title'] = $this->title;
$this->params['header_append'] = $this->header_append;
$this->params['footer'] = $this->footer;
$this->params['_id'] = $this->getId();
return parent::run();
}
开发者ID:tqsq2005,项目名称:dotplant2,代码行数:14,代码来源:BackendWidget.php
示例17: run
public function run()
{
app\backend\assets\FrontendEditingAsset::register($this->view);
$items = [['label' => Icon::show('dashboard') . ' ' . Yii::t('app', 'Backend'), 'url' => ['/backend/']]];
switch (Yii::$app->requestedRoute) {
case 'shop/product/list':
if (isset($_GET['properties'])) {
$apply_if_params = [];
foreach ($_GET['properties'] as $property_id => $values) {
if (isset($values[0])) {
$apply_if_params[$property_id] = $values[0];
}
}
if (Yii::$app->response->dynamic_content_trait === true) {
$items[] = ['label' => Icon::show('puzzle') . ' ' . Yii::t('app', 'Edit Dynamic Content'), 'url' => ['/backend/dynamic-content/edit', 'id' => Yii::$app->response->matched_dynamic_content_trait_model->id]];
} else {
if (isset($_GET['properties'], $_GET['last_category_id'])) {
$items[] = ['label' => Icon::show('puzzle') . ' ' . Yii::t('app', 'Add Dynamic Content'), 'url' => ['/backend/dynamic-content/edit', 'DynamicContent' => ['apply_if_params' => Json::encode($apply_if_params), 'apply_if_last_category_id' => $_GET['last_category_id'], 'object_id' => Object::getForClass(app\modules\shop\models\Product::className())->id, 'route' => 'shop/product/list']]];
}
}
} else {
// no properties selected - go to category edit page
if (isset($_GET['last_category_id'])) {
$reviewsLink = $this->getReviewEditParams("Category", intval($_GET['last_category_id']));
$cat = app\modules\shop\models\Category::findById($_GET['last_category_id']);
$items[] = ['label' => Icon::show('pencil') . ' ' . Yii::t('app', 'Edit category'), 'url' => ['/shop/backend-category/edit', 'id' => $cat->id, 'parent_id' => $cat->parent_id]];
}
}
break;
case 'shop/product/show':
if (isset($_GET['model_id'])) {
$reviewsLink = $this->getReviewEditParams("Product", intval($_GET['model_id']));
$items[] = ['label' => Icon::show('pencil') . ' ' . Yii::t('app', 'Edit product'), 'url' => ['/shop/backend-product/edit', 'id' => intval($_GET['model_id'])]];
}
break;
case '/page/page/show':
case '/page/page/list':
if (isset($_GET['id'])) {
$page = app\modules\page\models\Page::findById($_GET['id']);
$reviewsLink = $this->getReviewEditParams("Page", $_GET['id']);
$items[] = ['label' => Icon::show('pencil') . ' ' . Yii::t('app', 'Edit page'), 'url' => ['/page/backend/edit', 'id' => $page->id, 'parent_id' => $page->parent_id]];
}
break;
}
if (!empty($reviewsLink)) {
$items[] = $reviewsLink;
}
return $this->render('floating-panel', ['items' => $items, 'bottom' => $this->bottom]);
}
开发者ID:lzpfmh,项目名称:dotplant2,代码行数:49,代码来源:FloatingPanel.php
示例18: init
public function init()
{
Icon::map($this->grid->getView());
$this->registerTranslations();
parent::init();
// TODO: Change the autogenerated stub
$this->value = function ($model, $key, $index, $widget) {
$lockIcon = '';
if ($this->showLock) {
if ($model->hasAttribute('locked') && $model->{$model->lockedAttribute}) {
$lockIcon = Icon::show('eye-slash');
} else {
$lockIcon = Icon::show('eye');
}
}
return Html::a($lockIcon . $model->{$this->attribute}, ['update', 'id' => $model->id], ['title' => self::t('messages', 'Edit item')]);
};
}
开发者ID:sibds,项目名称:yii2-gridhelper,代码行数:18,代码来源:UrlColumn.php
示例19: initDefaultButtons
/**
* Initializes the default button rendering callbacks
*/
protected function initDefaultButtons()
{
if (!isset($this->buttons['view'])) {
$this->buttons['view'] = function ($url, $model) {
return Html::a(Icon::show('eye', ['class' => 'fa-lg'], Icon::FA), $url, ['title' => \Yii::t('yii', 'View'), 'data-pjax' => '0']);
};
}
if (!isset($this->buttons['update'])) {
$this->buttons['update'] = function ($url, $model) {
return Html::a(Icon::show('edit', ['class' => 'fa-lg'], Icon::FA), $url, ['title' => \Yii::t('yii', 'Update'), 'data-pjax' => '0']);
};
}
if (!isset($this->buttons['delete'])) {
$this->buttons['delete'] = function ($url, $model) {
return Html::a(Icon::show('trash-o', ['class' => 'fa-lg'], Icon::FA), $url, ['title' => \Yii::t('yii', 'Delete'), 'data-confirm' => \Yii::t('yii', 'Are you sure to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0']);
};
}
}
开发者ID:tqsq2005,项目名称:dotplant2,代码行数:21,代码来源:ActionColumn.php
示例20: getdocfiles_iconshow
public function getdocfiles_iconshow()
{
$excel = '<span style="font-size: 19px; color: green;">' . Icon::show('file-excel-o') . '</span>';
$word = '<span style="font-size: 19px; color: blue;">' . Icon::show('file-word-o') . '</span>';
$pdf = '<span style="font-size: 19px; color: red;">' . Icon::show('file-pdf-o') . '</span>';
$image = '<span style="font-size: 19px; color: orange;">' . Icon::show('file-image-o') . '</span>';
$text = '<span style="font-size: 19px; color: black;">' . Icon::show('file-text-o') . '</span>';
if (in_array($this->docfiles_ext, ['XLS', 'XLSX'])) {
return $excel;
} elseif (in_array($this->docfiles_ext, ['DOC', 'DOCX'])) {
return $word;
} elseif (in_array($this->docfiles_ext, ['PDF'])) {
return $pdf;
} elseif (in_array($this->docfiles_ext, ['PNG', 'JPG', 'JPEG', 'TIFF'])) {
return $image;
} elseif (in_array($this->docfiles_ext, ['TXT'])) {
return $text;
}
}
开发者ID:vovancho,项目名称:yii2test,代码行数:19,代码来源:Docfiles.php
注:本文中的kartik\icons\Icon类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论