本文整理汇总了PHP中dmstr\bootstrap\Tabs::getParentRelationRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP Tabs::getParentRelationRoute方法的具体用法?PHP Tabs::getParentRelationRoute怎么用?PHP Tabs::getParentRelationRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dmstr\bootstrap\Tabs
的用法示例。
在下文中一共展示了Tabs::getParentRelationRoute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
<?php
echo Html::a('<span class="glyphicon glyphicon-list"></span> ' . Yii::t('app', 'List All') . ' Videos', ['video/index'], ['class' => 'btn text-muted btn-xs']);
?>
<?php
echo Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('app', 'New') . ' Video', ['video/create', 'Video' => ['video_gallery_id' => $model->id]], ['class' => 'btn btn-success btn-xs']);
?>
</p><div class='clearfix'></div>
<?php
Pjax::begin(['id' => 'pjax-Videos', 'linkSelector' => '#pjax-Videos ul.pagination a']);
echo \yii\grid\GridView::widget(['dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getVideos(), 'pagination' => ['pageSize' => 10]]), 'columns' => ['id', 'title', 'youtube_url:url', 'published_at', ['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
$returnUrl = \Yii::$app->request->url;
if (strpos($returnUrl, 'returnUrl') !== false) {
$returnUrl = urldecode(substr($returnUrl, strpos($returnUrl, 'returnUrl') + 10, strlen($returnUrl)));
} else {
$returnUrl = Tabs::getParentRelationRoute(\Yii::$app->controller->id) !== null ? Tabs::getParentRelationRoute(\Yii::$app->controller->id) : null;
}
$params = is_array($key) ? $key : [$model->primaryKey()[0] => (string) $key, 'returnUrl' => $returnUrl];
$params[0] = 'video' . '/' . $action;
return Url::toRoute($params);
}, 'buttons' => [], 'controller' => 'video']]]);
Pjax::end();
$this->endBlock();
?>
<?php
echo Tabs::widget(['id' => 'relation-tabs', 'encodeLabels' => false, 'items' => [['label' => '<span class="glyphicon glyphicon-asterisk"></span> VideoGallery', 'content' => $this->blocks['dmstr\\modules\\news\\models\\VideoGallery'], 'active' => true], ['label' => '<small><span class="glyphicon glyphicon-paperclip"></span> Videos</small>', 'content' => $this->blocks['Videos'], 'active' => false]]]);
?>
</div>