version: '2'
services:
nginx:
build:
context: .
dockerfile: ./images/nginx/Dockerfile
FROM nginx:latest
COPY ["domains/docker.test", "/var/www/docker-bar.test"]
FROM php:apache
COPY ./public-html/ /var/www/html/
<?php
phpinfo();
docker build -t test-php . && docker run -d -P --name test-php test-php
if ( Choice_Menu::viewMenuItemsTop('top-menu') ) {
echo Nav::widget([
'options' => ['class' => 'navbar-nav'],
'items' => Choice_Menu::viewMenuItemsTop('top-menu'),
]);
}
namespace app\modules\manager\models;
use app\modules\manager\models\MenuModel;
use app\modules\manager\models\MenuItemsModel;
/**
* Description of Choice_Menu
*
* @author Максимус
*/
class Choice_Menu
{
/**
* @inheritdoc
*/
private static function getMenuItemsTop($nameMenu)
{
$items = [];
$code = $nameMenu;
$query_menu = MenuModel::find()
->andWhere(['code' => $code, 'status' => 1])
->one();
$query = MenuItemsModel::find()
->andWhere([
'menu_id' => $query_menu->id,
'status' => 1
])
->all();
foreach ($query as $item)
{
if ( empty($items[$item->parent_id]) )
{
$items[$items->parent_id] = [];
}
$items[$item->parent_id][] = $item->attributes;
}
return $items;
}
/*
* @inheritdoc
*/
public static function viewMenuItemsTop($nameMenu, $parentId = 0)
{
$array = self::getMenuItemsTop($nameMenu);
if ( empty($array[$parentId]) ) { return; }
for ( $i = 0; $i < count($array[$parentId]); $i++ )
{
$result[] = [
'label' => $array[$parentId][$i]['name'],
'url' => [$array[$parentId][$i]['url_item'].'/index'],
'items' => self::viewMenuItemsTop($array[$parentId][$i]['id'], $nameMenu)
];
}
return $result;
}
}
$this->registerJs("CKEDITOR.plugins.addExternal('pbckcode', 'plugins/pbckcode/plugin.js', '');", $this::POS_READY, 'tinymcepluginpbckcode');
<?= $form->field($model, 'content')->widget(CKEditor::className(), [
'preset' => 'custom',
'options' => ['rows' => 15],
'clientOptions' => [
'extraPlugins' => 'pbckcode',
'toolbarGroups' => [
['name' => 'undo'],
['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
['name' => 'colors'],
['name' => 'links', 'groups' => ['links', 'insert']],
['name' => 'others', 'groups' => ['others', 'about']],
//['name' => 'youtube'], // <--- OUR NEW PLUGIN YAY!
['name' => 'pbckcode']
]
],
]) ?>
['label' => '', 'url' => ['/site/index'], 'linkOptions' => ['class' => 'fa fa-home']]