1 | <?php |
||
2 | |||
3 | /** |
||
4 | * main. |
||
5 | * |
||
6 | * Layout web application basic |
||
7 | **/ |
||
8 | |||
9 | use terabytesoft\widgets\Alert; |
||
10 | use terabytesoft\app\basic\assets\AppAsset; |
||
11 | use yii\bootstrap4\Html; |
||
12 | use yii\bootstrap4\Nav; |
||
13 | use yii\bootstrap4\NavBar; |
||
14 | use yii\bootstrap4\Breadcrumbs; |
||
15 | |||
16 | 12 | AppAsset::register($this); |
|
17 | |||
18 | 12 | $menuItems = \Yii::$app->params['app.basic.menu.isguest']; |
|
19 | |||
20 | 12 | if (isset(\Yii::$app->extensions['terabytesoftw/app-user']) || (YII_ENV === 'test')) { |
|
0 ignored issues
–
show
introduced
by
![]() |
|||
21 | 12 | switch (\Yii::$app->user->isGuest) { |
|
22 | case true: |
||
23 | 12 | $menuItems = array_merge($menuItems, \Yii::$app->params['app.basic.setting.menu.user.isguest']); |
|
24 | 12 | break; |
|
25 | 1 | case false: |
|
26 | 1 | $menuItems = \Yii::$app->params['app.basic.setting.menu.user.logged']; |
|
27 | 1 | break; |
|
28 | } |
||
29 | } |
||
30 | ?> |
||
31 | |||
32 | <?php $this->beginPage() ?> |
||
33 | |||
34 | <!DOCTYPE html> |
||
35 | <?= Html::beginTag('html', ['lang' => \Yii::$app->language]) ?> |
||
36 | |||
37 | <?= Html::beginTag('head') ?> |
||
38 | <?= Html::tag('meta', '', ['charset' => \Yii::$app->charset]) ?> |
||
39 | <?= Html::tag('meta', '', ['http-equiv' => 'X-UA-Compatible', 'content' => 'IE=edge']) ?> |
||
40 | <?= Html::tag('meta', '', ['name' => 'viewport', 'content' => 'width=device-width, initial-scale=1']) ?> |
||
41 | <?= Html::csrfMetaTags() ?> |
||
42 | <?= Html::tag('title', Html::encode($this->title)) ?> |
||
43 | <?php $this->head() ?> |
||
44 | <?= Html::endTag('head') ?> |
||
45 | |||
46 | <?php $this->beginBody() ?> |
||
47 | |||
48 | <?= Html::beginTag('body') ?> |
||
49 | |||
50 | <?= Html::beginTag('wrapper', ['class' => 'd-flex flex-column']) ?> |
||
51 | |||
52 | <?php NavBar::begin([ |
||
53 | 12 | 'brandLabel' => \Yii::t('app.basic', \Yii::$app->name), |
|
54 | 12 | 'brandUrl' => \Yii::$app->homeUrl, |
|
55 | 'options' => [ |
||
56 | 'class' => 'navbar navbar-dark bg-dark navbar-expand-lg', |
||
57 | ], |
||
58 | ]); |
||
59 | |||
60 | 12 | echo Nav::widget([ |
|
61 | 12 | 'options' => ['class' => 'navbar-nav float-right ml-auto'], |
|
62 | 12 | 'items' => $menuItems, |
|
63 | ]); |
||
64 | |||
65 | NavBar::end(); ?> |
||
66 | |||
67 | <?= Alert::widget() ?> |
||
68 | |||
69 | 12 | <?= Html::beginTag( |
|
70 | 12 | 'div', |
|
71 | [ |
||
72 | 'class' => in_array( |
||
73 | 12 | $this->context->action->uniqueId, |
|
74 | [ |
||
75 | 'site/index', |
||
76 | 'site/about' |
||
77 | ] |
||
78 | ) |
||
79 | 3 | ? 'd-flex flex-fill align-items-center justify-content-center' |
|
80 | 12 | : 'container flex-fill' |
|
81 | ] |
||
82 | ) ?> |
||
83 | |||
84 | 12 | <?= Breadcrumbs::widget([ |
|
85 | 12 | 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], |
|
86 | ]) ?> |
||
87 | |||
88 | <?= $content ?> |
||
89 | |||
90 | <?= Html::endTag('div') ?> |
||
91 | |||
92 | <?= Html::beginTag('footer', ['class' => 'footer']) ?> |
||
93 | |||
94 | <?= Html::beginTag('div', ['class' => 'container flex-fill']) ?> |
||
95 | |||
96 | <?= Html::beginTag('p', ['class' => 'float-left']) ?> |
||
97 | <?= \Yii::$app->params['app.basic.footer.autor']?> |
||
98 | <?= Html::endTag('p') ?> |
||
99 | |||
100 | <?= Html::beginTag('p', ['class' => 'float-right']) ?> |
||
101 | <?= \Yii::t('app.basic', 'Powered by') ?> |
||
102 | 12 | <?= Html::a( |
|
103 | 12 | \Yii::t( |
|
104 | 12 | 'app.basic', |
|
105 | 12 | 'Yii Framework' |
|
106 | ), |
||
107 | 12 | 'http://www.yiiframework.com/', |
|
108 | 12 | ['rel' => 'external'] |
|
109 | ) ?> |
||
110 | <?= Html::endTag('p') ?> |
||
111 | |||
112 | <?= Html::endTag('div') ?> |
||
113 | |||
114 | <?= Html::endTag('footer') ?> |
||
115 | |||
116 | <?= Html::endTag('wrapper') ?> |
||
117 | |||
118 | <?= Html::endTag('body') ?> |
||
119 | |||
120 | <?php $this->endBody() ?> |
||
121 | |||
122 | <?= Html::endTag('html') ?> |
||
123 | |||
124 | <?php $this->endPage() ?> |
||
125 |