Yii
- 1 ответ
- 0 вопросов
3
Вклад в тег
composer require grozzzny/depends "dev-master"
class AppAsset extends AssetBundle
{
public $depends = [
'yii\web\YiiAsset',
'grozzzny\depends\bootstrap4\Bootstrap4Asset',
'grozzzny\depends\bootstrap4\Bootstrap4PluginAsset',
];
}
class Bootstrap4Asset extends AssetBundle
{
public $sourcePath = '@vendor/twbs/bootstrap/dist';
public $css = [
'css/bootstrap.css',
];
public function init()
{
parent::init(); // TODO: Change the autogenerated stub
Yii::$app->view->on(View::EVENT_AFTER_RENDER, function (){
unset(Yii::$app->view->assetBundles['yii\bootstrap\BootstrapAsset']);
});
Yii::$app->view->on(View::EVENT_BEGIN_BODY, function (){
unset(Yii::$app->view->assetBundles['yii\bootstrap\BootstrapAsset']);
});
}
}
<?= Nav::widget([
'options' => ['class' => 'navbar-nav d-flex justify-content-between w-100'],
'items' => [
[
'label' => ''Услуги,
'options' => ['class' => 'nav-item'],
'linkOptions' => ['class' => 'nav-link'],
'url' => ['services'],
'active' => Yii::$app->controller->id == 'services'
],
....
[
'label' => 'Контакты',
'options' => ['class' => 'nav-item'],
'linkOptions' => ['class' => 'nav-link'],
'active' => Yii::$app->controller->id == 'contacts',
'url' => ['/contacts']
]
]
]);?>
<nav aria-label="breadcrumb" class="mb-3">
<?= Breadcrumbs::widget([
'links' => $this->params['breadcrumbs'],
'options' => ['class' => 'breadcrumb'],
'tag' => 'ol',
'itemTemplate' => "<li class='breadcrumb-item'>{link}</li>\n",
'activeItemTemplate' => "<li class=\"breadcrumb-item active\" aria-current=\"page\">{link}</li>\n",
])?>
</nav>
<nav aria-label="Page navigation">
<?= LinkPager::widget([
'pagination' => $provider->pagination,
'linkContainerOptions' => ['class' => 'page-item'],
'linkOptions' => ['class' => 'page-link'],
'disabledListItemSubTagOptions' => ['tag' => 'a', 'class' => 'page-link']
]) ?>
</nav>
<?= Alert::widget([
'options' => ['class' => 'alert alert-danger show', 'role' => 'alert'],
'body' => $message,
]) ?>
composer create-project --prefer-dist --stability=dev grozzzny/yiicms www dev-master
class AppAsset extends AssetBundle
{
public $depends = [
..
//Material Design for Bootstrap 4
'grozzzny\depends\mdbootstrap\MDBootstrapAsset',
'grozzzny\depends\mdbootstrap\MDBootstrapPluginAsset',
..
];
}
'assetManager' => [
'bundles' => [
// Если решили переопределить scss:
'grozzzny\depends\mdbootstrap\MDBootstrapAsset' => [
'basePath' => '@webroot',
'baseUrl' => '@web',
'css' => ['css/mdbootstrap/mdb.css'],
],
// Если решили подключить доступные модули в коллекции MDB:
'grozzzny\depends\mdbootstrap\MDBootstrapPluginAsset' => [
'chart' => true,
'enhancedModals' => true,
'formsFree' => true,
'jqueryEasing' => true,
'scrollingNavbar' => true,
'velocity' => true,
'waves' => true,
'wow' => true,
],
],
],