-
Notifications
You must be signed in to change notification settings - Fork 0
/
more.php
154 lines (120 loc) · 3.25 KB
/
more.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
/**
* Created by PhpStorm.
* User: SoS
* Date: 02.06.2018
* Time: 15:00
*/
use trntv\filekit\behaviors\UploadBehavior;
use yii\helpers\Html;
?>
<?= Html::img(Yii::getAlias('@web') . '/uploads/' . $item->img) ?>
<div class="paginator">
<?php
echo \yii\widgets\LinkPager::widget([
'pagination' => $pages,
'options' => ['class' => false],
'prevPageLabel' => false,
'nextPageLabel' => false,
'activePageCssClass' => 'activeItem',
]);?>
</div>
<?php
public $image;
/**
* @inheritdoc
*/
public function behaviors()
{
return [
[
'class' => UploadBehavior::className(),
'attribute' => 'image',
'pathAttribute' => 'path',
'baseUrlAttribute' => 'base_url',
'typeAttribute' => 'type'
],
];
}
?>
/////////////////////////////////////
?>
<?php echo $form->field($model, 'image')->widget(
\trntv\filekit\widget\Upload::className(),
['url' => ['/file-storage/upload'],]
) ?>
<?php
////////////////////////////
['attribute' => 'path',
'format' => 'html',
'value' => function ($model) {
return Html::img(Yii::$app->glide->createSignedUrl(['glide/index',
'path' => $model->path], true), ['style' => 'max-width: 200px']);
}],
/////////////////////////////////
['attribute' => 'status',
'value' => function($model)
{
return $model->status == 1 ? '<p style="color:#0b58a2">Published</p>' : '<p style="color:#f00">Not published</p>';
},
'format' => 'html',],
////////////////////////////////
?>
<?php echo $form->field($model, 'content_en')->widget(
\yii\imperavi\Widget::className(),
['plugins' => ['fullscreen', 'fontcolor', 'video'],
'options' => ['minHeight' => 200,
'maxHeight' => 200,
'buttonSource' => true,
'convertDivs' => false,
'removeEmptyTags' => true,]]
) ?>
<?php echo $form->field($model, 'content_ru')->widget(
\yii\imperavi\Widget::className(),
['plugins' => ['fullscreen', 'fontcolor', 'video'],
'options' => ['minHeight' => 200,
'maxHeight' => 200,
'buttonSource' => true,
'convertDivs' => false,
'removeEmptyTags' => true,]]
) ?>
<?php echo $form->field($model, 'content_uz')->widget(
\yii\imperavi\Widget::className(),
['plugins' => ['fullscreen', 'fontcolor', 'video'],
'options' => ['minHeight' => 200,
'maxHeight' => 200,
'buttonSource' => true,
'convertDivs' => false,
'removeEmptyTags' => true,]]
) ?>
////////////////////////////////
<?php
['attribute' => 'path',
'value' => function($model){
return '<a href="'.$model->base_url.'/'.$model->path.'" download="" >Download resume</a>';
},
'format' => 'html',],
/////////////////////////////////
?>
<?php
public function getTitle(){
if (Yii::$app->language == 'en'): return $this->title_en;
endif;
if (Yii::$app->language == 'ru'): return $this->title_ru;
endif;
if (Yii::$app->language == 'uz'): return $this->title_uz;
endif;
}
public function getContent(){
if (Yii::$app->language == 'en'): return $this->content_en;
endif;
if (Yii::$app->language == 'ru'): return $this->content_ru;
endif;
if (Yii::$app->language == 'uz'): return $this->content_uz;
endif;
}
?>
/////////////////////////////////////////
<?= Html::img(Yii::$app->glide->createSignedUrl(['glide/index',
'path' => $item->path], true), ['alt' => $item->title])
?>