本文整理汇总了PHP中dmstr\bootstrap\Tabs类的典型用法代码示例。如果您正苦于以下问题:PHP Tabs类的具体用法?PHP Tabs怎么用?PHP Tabs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Tabs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: actionView
/**
* Displays a single Role model.
* @param integer $id
*
* @return mixed
*/
public function actionView($id)
{
\Yii::$app->session['__crudReturnUrl'] = Url::previous();
Url::remember();
Tabs::rememberActiveState();
return $this->render('view', ['model' => $this->findModel($id)]);
}
开发者ID:febfeb,项目名称:yii2-basic-ready,代码行数:13,代码来源:RoleController.php
示例2: actionIndex
/**
* Lists all Less models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new LessSearch();
$dataProvider = $searchModel->search($_GET);
Tabs::clearLocalStorage();
Url::remember();
\Yii::$app->session['__crudReturnUrl'] = null;
return $this->render('index', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel]);
}
开发者ID:dmstr,项目名称:yii2-prototype-module,代码行数:13,代码来源:LessController.php
示例3: actionView
/**
* Displays a single ImageGallery model.
* @param integer $id
* @param null $returnUrl
*
* @return mixed
*/
public function actionView($id, $returnUrl = null)
{
Tabs::rememberActiveTab(\Yii::$app->request->url, $this->id);
if ($returnUrl === null) {
$returnUrl = $this->module->id ? $this->module->id . '/' . $this->id . '/' . $this->action->id : $this->id . '/' . $this->action->id;
$returnUrl = \Yii::$app->urlManager->createUrl([$returnUrl, 'id' => $id]);
}
Url::remember($returnUrl);
return $this->render('view', ['model' => $this->findModel($id)]);
}
开发者ID:dmstr,项目名称:yii2-news-module,代码行数:17,代码来源:ImageGalleryController.php
示例4: actionView
/**
* Displays a single Country model.
* @param integer $country_id
*
* @return mixed
*/
public function actionView($country_id)
{
$resolved = \Yii::$app->request->resolve();
$resolved[1]['_pjax'] = null;
$url = Url::to(array_merge(['/' . $resolved[0]], $resolved[1]));
\Yii::$app->session['__crudReturnUrl'] = Url::previous();
Url::remember($url);
Tabs::rememberActiveState();
return $this->render('view', ['model' => $this->findModel($country_id)]);
}
开发者ID:schmunk42,项目名称:giiant-crud-examples,代码行数:16,代码来源:CountryController.php
示例5: actionView
/**
* Displays a single Subdistrict model.
* @param integer $id
*
* @return mixed
*/
public function actionView($id)
{
$model = $this->findModel($id);
if ($model->operation->allowView == FALSE) {
throw $model->operation->exception('view');
}
\Yii::$app->session['__crudReturnUrl'] = ReturnUrl::getUrl(Url::previous());
Url::remember();
Tabs::rememberActiveState();
return $this->render('view', ['model' => $model]);
}
开发者ID:fredyns,项目名称:yii2-boilerplate,代码行数:17,代码来源:SubdistrictController.php
示例6: actionView
/**
* Displays a single Table model.
* @param integer $id
*
* @return mixed
*/
public function actionView($id)
{
$table = $this->findModel($id);
$searchModel = null;
$dataProvider = null;
if ($table->model_search_class != null) {
$class = $table->model_search_class;
$searchModel = new $class();
$dataProvider = $searchModel->search($_GET);
}
\Yii::$app->session['__crudReturnUrl'] = Url::previous();
Url::remember();
Tabs::rememberActiveState();
return $this->render('view', ['model' => $table, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
}
开发者ID:febfeb,项目名称:yii2-dynamic-field,代码行数:21,代码来源:TableController.php
示例7: actionView
/**
* Displays a single Budget model.
* @param integer $id
*
* @return mixed
*/
public function actionView($id)
{
$modelHistory = new BudgetHistory();
$historySearch = new BudgetHistorySearch();
$providerIncome = $historySearch->searchItems($id, BudgetItem::TYPE_INCOME, Yii::$app->request->queryParams);
$providerCost = $historySearch->searchItems($id, BudgetItem::TYPE_COST, Yii::$app->request->queryParams);
\Yii::$app->session['__crudReturnUrl'] = Url::previous();
Url::remember();
Tabs::rememberActiveState();
try {
if ($modelHistory->load($_POST) && $modelHistory->save()) {
return $this->redirect(Url::previous());
} elseif (!\Yii::$app->request->isPost) {
$modelHistory->load($_GET);
}
} catch (\Exception $e) {
$msg = isset($e->errorInfo[2]) ? $e->errorInfo[2] : $e->getMessage();
$modelHistory->addError('_exception', $msg);
}
return $this->render('view', ['model' => $this->findModel($id), 'modelHistory' => $modelHistory, 'providerIncome' => $providerIncome, 'providerCost' => $providerCost]);
}
开发者ID:alexus007,项目名称:budget,代码行数:27,代码来源:BudgetController.php
示例8:
<div class="panel-body">
<?php
$this->beginBlock('common\\models\\UserProfile');
?>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'user_id', 'name', 'lastname', 'lesson_cost:url', 'currency_id', 'created_at', 'updated_ad']]);
?>
<hr/>
<?php
echo Html::a('<span class="glyphicon glyphicon-trash"></span> ' . 'Delete', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data-confirm' => '' . 'Are you sure to delete this item?' . '', 'data-method' => 'post']);
?>
<?php
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<span class="glyphicon glyphicon-asterisk"></span> UserProfile', 'content' => $this->blocks['common\\models\\UserProfile'], 'active' => true]]]);
?>
</div>
</div>
</div>
开发者ID:RubenDjOn,项目名称:PrivateTeacher,代码行数:29,代码来源:view.php
示例9:
<div class="form-group">
<label class="control-label col-sm-3" for="budgetitem-date">Планируемая дата</label>
<div class="col-sm-6">
<?php
echo kartik\date\DatePicker::widget(['model' => $model, 'attribute' => 'date', 'pluginOptions' => ['format' => 'dd.mm.yyyy', 'class' => 'col-sm-6']]);
?>
</div>
</div>
<?php
$this->endBlock();
?>
<?php
echo Tabs::widget(['encodeLabels' => false, 'items' => [['label' => Yii::t('app', 'Budget Item'), 'content' => $this->blocks['main'], 'active' => true]]]);
?>
<hr/>
<?php
echo $form->errorSummary($model);
?>
<?php
echo Html::submitButton('<span class="glyphicon glyphicon-check"></span> ' . ($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save')), ['id' => 'save-' . $model->formName(), 'class' => 'btn btn-success']);
?>
<?php
ActiveForm::end();
?>
</div>
开发者ID:alexus007,项目名称:budget,代码行数:30,代码来源:_form.php
示例10: count
?>
<?php
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . 'New' . ' Payment', ['payment/create', 'Payment' => ['created_by' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php
$this->endBlock();
?>
<?php
$this->beginBlock('UserProfile');
?>
<div style='position: relative'><div style='position:absolute; right: 0px; top 0px;'>
<?php
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . 'List All' . ' User Profile', ['user-profile/index'], ['class' => 'btn text-muted btn-xs']);
?>
<?php
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . 'New' . ' User Profile', ['user-profile/create', 'UserProfile' => ['user_id' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<span class="glyphicon glyphicon-asterisk"></span> User', 'content' => $this->blocks['common\\models\\User'], 'active' => true], ['content' => $this->blocks['Students'], 'label' => '<small>Students <span class="badge badge-default">' . count($model->getStudents()->asArray()->all()) . '</span></small>', 'active' => false], ['content' => $this->blocks['Payments'], 'label' => '<small>Payments <span class="badge badge-default">' . count($model->getPayments()->asArray()->all()) . '</span></small>', 'active' => false], ['content' => $this->blocks['UserProfile'], 'label' => '<small>User Profile <span class="badge badge-default">' . count($model->getUserProfile()->asArray()->all()) . '</span></small>', 'active' => false]]]);
?>
</div>
</div>
</div>
开发者ID:RubenDjOn,项目名称:PrivateTeacher,代码行数:30,代码来源:view.php
示例11:
</div>
</div>
<?php
$this->beginBlock('common\\models\\location\\LocationCurrent');
?>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['format' => 'html', 'attribute' => 'user_id', 'value' => $model->getUser()->one() ? Html::a($model->getUser()->one()->id, ['user/view', 'id' => $model->getUser()->one()->id]) : '<span class="label label-warning">?</span>'], ['format' => 'html', 'attribute' => 'event_id', 'value' => $model->getEvent()->one() ? Html::a($model->getEvent()->one()->id, ['event/view', 'id' => $model->getEvent()->one()->id]) : '<span class="label label-warning">?</span>'], 'is_origin', 'title', 'latitude', 'longitude', 'occur_at', 'created_at']]);
?>
<hr/>
<?php
echo Html::a('<span class="glyphicon glyphicon-trash"></span> ' . 'Delete', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data-confirm' => '' . 'Are you sure to delete this item?' . '', 'data-method' => 'post']);
?>
<?php
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<b class=""># ' . $model->id . '</b>', 'content' => $this->blocks['common\\models\\location\\LocationCurrent'], 'active' => true]]]);
?>
</div>
开发者ID:aixiaobenaixiaoben,项目名称:find,代码行数:30,代码来源:view.php
示例12: function
?>
</div></div><?php
Pjax::begin(['id' => 'pjax-Films', 'enableReplaceState' => false, 'linkSelector' => '#pjax-Films ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getFilmCategories(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-filmcategories']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => Yii::t('app', 'First'), 'lastPageLabel' => Yii::t('app', 'Last')], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {delete}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
// using the column name as key, not mapping to 'id' like the standard generator
$params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
$params[0] = 'film-category' . '/' . $action;
return Url::toRoute($params);
}, 'buttons' => ['delete' => function ($url, $model) {
return yii\helpers\Html::a('<span class="glyphicon glyphicon-remove"></span>', $url, ['class' => 'text-danger', 'title' => Yii::t('app', 'Remove'), 'data-confirm' => Yii::t('app', 'Are you sure you want to delete the related item?'), 'data-method' => 'post', 'data-pjax' => '0']);
}, 'view' => function ($url, $model) {
return yii\helpers\Html::a('<span class="glyphicon glyphicon-cog"></span>', $url, ['data-title' => Yii::t('app', 'View Pivot Record'), 'data-toggle' => 'tooltip', 'data-pjax' => '0', 'class' => 'text-muted']);
}], 'controller' => 'film-category'], ["class" => yii\grid\DataColumn::className(), "attribute" => "film_id", "value" => function ($model) {
if ($rel = $model->getFilm()->one()) {
return yii\helpers\Html::a($rel->title, ["film/view", 'film_id' => $rel->film_id], ["data-pjax" => 0]);
} else {
return '';
}
}, "format" => "raw"], 'last_update']]) . '</div>';
Pjax::end();
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<span class="glyphicon glyphicon-asterisk"></span> Category', 'content' => $this->blocks['giiant\\sakila\\models\\Category'], 'active' => true], ['content' => $this->blocks['Films'], 'label' => '<small>Films <span class="badge badge-default">' . count($model->getFilms()->asArray()->all()) . '</span></small>', 'active' => false]]]);
?>
</div>
</div>
</div>
开发者ID:schmunk42,项目名称:giiant-crud-examples,代码行数:30,代码来源:view.php
示例13:
<h3>
<?php
echo $model->actor_id;
?>
</h3>
<?php
$this->beginBlock('app\\modules\\sakila\\models\\FilmActor');
?>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => [['format' => 'html', 'attribute' => 'actor_id', 'value' => $model->getActor()->one() ? Html::a($model->getActor()->one()->label, ['actor/view', 'actor_id' => $model->getActor()->one()->actor_id]) : '<span class="label label-warning">?</span>'], ['format' => 'html', 'attribute' => 'film_id', 'value' => $model->getFilm()->one() ? Html::a($model->getFilm()->one()->title, ['film/view', 'film_id' => $model->getFilm()->one()->film_id]) : '<span class="label label-warning">?</span>'], 'last_update']]);
?>
<hr/>
<?php
echo Html::a('<span class="glyphicon glyphicon-trash"></span> ' . Yii::t('app', 'Delete'), ['delete', 'actor_id' => $model->actor_id, 'film_id' => $model->film_id], ['class' => 'btn btn-danger', 'data-confirm' => '' . Yii::t('app', 'Are you sure to delete this item?') . '', 'data-method' => 'post']);
?>
<?php
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<span class="glyphicon glyphicon-asterisk"></span> FilmActor', 'content' => $this->blocks['app\\modules\\sakila\\models\\FilmActor'], 'active' => true]]]);
?>
</div>
开发者ID:shinkarenko,项目名称:playground,代码行数:30,代码来源:view.php
示例14: count
?>
<?php
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('app', 'New') . ' Vidmage Category', ['vidmage-category/create', 'VidmageCategory' => ['vidmage_id' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php
$this->endBlock();
?>
<?php
$this->beginBlock('VidmageTags');
?>
<div style='position: relative'><div style='position:absolute; right: 0px; top 0px;'>
<?php
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . Yii::t('app', 'List All') . ' Vidmage Tags', ['vidmage-tag/index'], ['class' => 'btn text-muted btn-xs']);
?>
<?php
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('app', 'New') . ' Vidmage Tag', ['vidmage-tag/create', 'VidmageTag' => ['vidmage_id' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<b class=""># ' . $model->id . '</b>', 'content' => $this->blocks['common\\models\\Vidmage'], 'active' => true], ['content' => $this->blocks['MemeVidmages'], 'label' => '<small>Meme Vidmages <span class="badge badge-default">' . count($model->getMemeVidmages()->asArray()->all()) . '</span></small>', 'active' => false], ['content' => $this->blocks['VidmageAuthors'], 'label' => '<small>Vidmage Authors <span class="badge badge-default">' . count($model->getVidmageAuthors()->asArray()->all()) . '</span></small>', 'active' => false], ['content' => $this->blocks['VidmageCategories'], 'label' => '<small>Vidmage Categories <span class="badge badge-default">' . count($model->getVidmageCategories()->asArray()->all()) . '</span></small>', 'active' => false], ['content' => $this->blocks['VidmageTags'], 'label' => '<small>Vidmage Tags <span class="badge badge-default">' . count($model->getVidmageTags()->asArray()->all()) . '</span></small>', 'active' => false]]]);
?>
</div>
</div>
</div>
开发者ID:RubenDjOn,项目名称:originofthememes,代码行数:30,代码来源:view.php
示例15: function
?>
<?php
$this->beginBlock('Files');
?>
<div style='position: relative'><div style='position:absolute; right: 0px; top: 0px;'>
<?php
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . Yii::t('app', 'List All') . ' Files', ['file/index'], ['class' => 'btn text-muted btn-xs']);
?>
<?php
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('app', 'New') . ' File', ['file/create', 'File' => ['sensorid' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php
Pjax::begin(['id' => 'pjax-Files', 'enableReplaceState' => false, 'linkSelector' => '#pjax-Files ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getFiles(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-files']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => Yii::t('app', 'First'), 'lastPageLabel' => Yii::t('app', 'Last')], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
// using the column name as key, not mapping to 'id' like the standard generator
$params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
$params[0] = 'file' . '/' . $action;
return $params;
}, 'buttons' => [], 'controller' => 'file'], 'id', 'filelink', 'filename', 'extension', 'startdate', 'enddate', 'status']]) . '</div>';
Pjax::end();
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<b class=""># ' . $model->id . '</b>', 'content' => $this->blocks['app\\models\\Sensor'], 'active' => true], ['content' => $this->blocks['Calibrations'], 'label' => '<small>Calibrations <span class="badge badge-default">' . count($model->getCalibrations()->asArray()->all()) . '</span></small>', 'active' => false], ['content' => $this->blocks['Files'], 'label' => '<small>Files <span class="badge badge-default">' . count($model->getFiles()->asArray()->all()) . '</span></small>', 'active' => false]]]);
?>
</div>
开发者ID:ICHydro,项目名称:anaconda,代码行数:30,代码来源:view.php
示例16: function
<div style='position: relative'><div style='position:absolute; right: 0px; top 0px;'>
<?php
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . Yii::t('app', 'List All') . ' Inventories', ['inventory/index'], ['class' => 'btn text-muted btn-xs']);
?>
<?php
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('app', 'New') . ' Inventory', ['inventory/create', 'Inventory' => ['film_id' => $model->film_id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php
Pjax::begin(['id' => 'pjax-Inventories', 'enableReplaceState' => false, 'linkSelector' => '#pjax-Inventories ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getInventories(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-inventories']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => Yii::t('app', 'First'), 'lastPageLabel' => Yii::t('app', 'Last')], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
// using the column name as key, not mapping to 'id' like the standard generator
$params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
$params[0] = 'inventory' . '/' . $action;
return Url::toRoute($params);
}, 'buttons' => [], 'controller' => 'inventory'], 'inventory_id', ["class" => yii\grid\DataColumn::className(), "attribute" => "store_id", "value" => function ($model) {
if ($rel = $model->getStore()->one()) {
return yii\helpers\Html::a($rel->label, ["store/view", 'store_id' => $rel->store_id], ["data-pjax" => 0]);
} else {
return '';
}
}, "format" => "raw"], 'last_update']]) . '</div>';
Pjax::end();
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<span class="glyphicon glyphicon-asterisk"></span> Film', 'content' => $this->blocks['app\\modules\\sakila\\models\\Film'], 'active' => true], ['label' => '<small><span class="glyphicon glyphicon-paperclip"></span> Actors</small>', 'content' => $this->blocks['Actors'], 'active' => false], ['label' => '<small><span class="glyphicon glyphicon-paperclip"></span> Categories</small>', 'content' => $this->blocks['Categories'], 'active' => false], ['label' => '<small><span class="glyphicon glyphicon-paperclip"></span> Inventories</small>', 'content' => $this->blocks['Inventories'], 'active' => false]]]);
?>
</div>
开发者ID:shinkarenko,项目名称:playground,代码行数:30,代码来源:view.php
示例17: function
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . 'List All' . ' Tiles Users', ['tiles-users/index'], ['class' => 'btn text-muted btn-xs']);
?>
<?php
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . 'New' . ' Tiles User', ['tiles-users/create', 'TilesUser' => ['tile' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</div></div><?php
Pjax::begin(['id' => 'pjax-TilesUsers', 'enableReplaceState' => false, 'linkSelector' => '#pjax-TilesUsers ul.pagination a, th a', 'clientOptions' => ['pjax:success' => 'function(){alert("yo")}']]);
echo '<div class="table-responsive">' . \yii\grid\GridView::widget(['layout' => '{summary}{pager}<br/>{items}{pager}', 'dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getTilesUsers(), 'pagination' => ['pageSize' => 20, 'pageParam' => 'page-tilesusers']]), 'pager' => ['class' => yii\widgets\LinkPager::className(), 'firstPageLabel' => 'First', 'lastPageLabel' => 'Last'], 'columns' => [['class' => 'yii\\grid\\ActionColumn', 'template' => '{view} {update}', 'contentOptions' => ['nowrap' => 'nowrap'], 'urlCreator' => function ($action, $model, $key, $index) {
// using the column name as key, not mapping to 'id' like the standard generator
$params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key];
$params[0] = 'tiles-users' . '/' . $action;
return $params;
}, 'buttons' => [], 'controller' => 'tiles-users'], ['class' => yii\grid\DataColumn::className(), 'attribute' => 'level', 'value' => function ($model) {
if ($rel = $model->getLevel()->one()) {
return Html::a($rel->id, ['levels/view', 'id' => $rel->id], ['data-pjax' => 0]);
} else {
return '';
}
}, 'format' => 'raw'], 'created_at', 'updated_at', 'created_by', 'updated_by']]) . '</div>';
Pjax::end();
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<b class=""># ' . $model->id . '</b>', 'content' => $this->blocks['common\\models\\Tiles'], 'active' => true], ['content' => $this->blocks['TilesUsers'], 'label' => '<small>Tiles Users <span class="badge badge-default">' . count($model->getTilesUsers()->asArray()->all()) . '</span></small>', 'active' => false]]]);
?>
</div>
</div>
</div>
开发者ID:romdim,项目名称:dbi-playground,代码行数:30,代码来源:view.php
示例18:
<div class="panel-body">
<?php
$this->beginBlock('giiant\\world\\models\\CountryLanguage');
?>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => [['format' => 'html', 'attribute' => 'CountryCode', 'value' => $model->getCountryCode()->one() ? Html::a($model->getCountryCode()->one()->Name, ['country/view', 'Code' => $model->getCountryCode()->one()->Code]) : '<span class="label label-warning">?</span>'], 'Language', 'IsOfficial', 'Percentage']]);
?>
<hr/>
<?php
echo Html::a('<span class="glyphicon glyphicon-trash"></span> ' . Yii::t('app', 'Delete'), ['delete', 'CountryCode' => $model->CountryCode, 'Language' => $model->Language], ['class' => 'btn btn-danger', 'data-confirm' => '' . Yii::t('app', 'Are you sure to delete this item?') . '', 'data-method' => 'post']);
?>
<?php
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<span class="glyphicon glyphicon-asterisk"></span> CountryLanguage', 'content' => $this->blocks['giiant\\world\\models\\CountryLanguage'], 'active' => true]]]);
?>
</div>
</div>
</div>
开发者ID:schmunk42,项目名称:giiant-crud-examples,代码行数:29,代码来源:view.php
示例19:
<div class="panel-body">
<?php
$this->beginBlock('giiant\\sakila\\models\\Payment');
?>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['payment_id', ['format' => 'html', 'attribute' => 'customer_id', 'value' => $model->getCustomer()->one() ? Html::a($model->getCustomer()->one()->customer_id, ['customer/view', 'customer_id' => $model->getCustomer()->one()->customer_id]) : '<span class="label label-warning">?</span>'], ['format' => 'html', 'attribute' => 'staff_id', 'value' => $model->getStaff()->one() ? Html::a($model->getStaff()->one()->staff_id, ['staff/view', 'staff_id' => $model->getStaff()->one()->staff_id]) : '<span class="label label-warning">?</span>'], ['format' => 'html', 'attribute' => 'rental_id', 'value' => $model->getRental()->one() ? Html::a($model->getRental()->one()->rental_id, ['rental/view', 'rental_id' => $model->getRental()->one()->rental_id]) : '<span class="label label-warning">?</span>'], 'amount', 'payment_date', 'last_update']]);
?>
<hr/>
<?php
echo Html::a('<span class="glyphicon glyphicon-trash"></span> ' . Yii::t('app', 'Delete'), ['delete', 'payment_id' => $model->payment_id], ['class' => 'btn btn-danger', 'data-confirm' => '' . Yii::t('app', 'Are you sure to delete this item?') . '', 'data-method' => 'post']);
?>
<?php
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<span class="glyphicon glyphicon-asterisk"></span> Payment', 'content' => $this->blocks['giiant\\sakila\\models\\Payment'], 'active' => true]]]);
?>
</div>
</div>
</div>
开发者ID:schmunk42,项目名称:giiant-crud-examples,代码行数:29,代码来源:view.php
示例20: function
return $model->city ? $model->city->linkTo : '<span class="label label-warning">?</span>';
}], ['attribute' => 'district_id', "format" => "raw", "options" => [], 'value' => function ($model) {
return $model->district ? $model->district->linkTo : '<span class="label label-warning">?</span>';
}], ['attribute' => 'subdistrict_id', "format" => "raw", "options" => [], 'value' => function ($model) {
return $model->subdistrict ? $model->subdistrict->linkTo : '<span class="label label-warning">?</span>';
}]]]) . '</div>';
?>
<?php
Pjax::end();
?>
<?php
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<b class=""># ' . $model->id . '</b>', 'content' => $this->blocks['Province'], 'active' => true], ['content' => $this->blocks['Cities'], 'label' => '<small>Cities <span class="badge badge-default">' . count($model->getCities()->asArray()->all()) . '</span></small>', 'active' => false], ['content' => $this->blocks['Postcodes'], 'label' => '<small>Postcodes <span class="badge badge-default">' . count($model->getPostcodes()->asArray()->all()) . '</span></small>', 'active' => false]]]);
?>
</div>
</div>
<br/>
<?php
echo Moderation::widget(['model' => $model]);
?>
</div>
开发者ID:fredyns,项目名称:yii2-boilerplate,代码行数:30,代码来源:view.php
注:本文中的dmstr\bootstrap\Tabs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论