Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
test-project
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Junaid Rahman pv
test-project
Commits
64f417aa
Commit
64f417aa
authored
Aug 31, 2016
by
dianc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Category Updated-3
parent
7bd28bad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
_form.php
backend/modules/theme/views/category/_form.php
+3
-1
index.php
backend/modules/theme/views/category/index.php
+11
-3
Category.php
common/models/Category.php
+1
-0
No files found.
backend/modules/theme/views/category/_form.php
View file @
64f417aa
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
yii\bootstrap\ActiveForm
;
use
yii\bootstrap\ActiveForm
;
use
trntv\filekit\widget\Upload
;
/* @var $this yii\web\View */
/* @var $this yii\web\View */
/* @var $model common\models\Category */
/* @var $model common\models\Category */
...
@@ -31,10 +32,11 @@ use yii\bootstrap\ActiveForm;
...
@@ -31,10 +32,11 @@ use yii\bootstrap\ActiveForm;
<?=
$form
->
field
(
$model
,
'status'
)
->
dropDownList
(
$model
::
statuses
(),
[
'prompt'
=>
''
])
?>
<?=
$form
->
field
(
$model
,
'status'
)
->
dropDownList
(
$model
::
statuses
(),
[
'prompt'
=>
''
])
?>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-3"
>
<div
class=
"col-md-3"
>
<?=
$form
->
field
(
$model
,
'image'
)
->
widget
(
<?=
$form
->
field
(
$model
,
'image'
)
->
widget
(
\trntv\filekit\widget\
Upload
::
className
(),
Upload
::
className
(),
[
[
'url'
=>
[
'/file-storage/upload'
],
'url'
=>
[
'/file-storage/upload'
],
])
->
label
(
'Image(1280x854)'
);
])
->
label
(
'Image(1280x854)'
);
...
...
backend/modules/theme/views/category/index.php
View file @
64f417aa
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
use
yii\helpers\Html
;
use
yii\helpers\Html
;
use
yii\grid\GridView
;
use
yii\grid\GridView
;
use
common\grid\EnumColumn
;
use
common\models\Category
;
/* @var $this yii\web\View */
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\theme\models\search\CategorySearch */
/* @var $searchModel backend\modules\theme\models\search\CategorySearch */
...
@@ -26,12 +28,18 @@ $this->params['breadcrumbs'][] = $this->title;
...
@@ -26,12 +28,18 @@ $this->params['breadcrumbs'][] = $this->title;
'columns'
=>
[
'columns'
=>
[
[
'class'
=>
'yii\grid\SerialColumn'
],
[
'class'
=>
'yii\grid\SerialColumn'
],
'id'
,
//
'id',
'name'
,
'name'
,
'slug'
,
//
'slug',
'description'
,
'description'
,
'image_url:url'
,
//
'image_url:url',
// 'image_path',
// 'image_path',
[
'class'
=>
EnumColumn
::
className
(),
'attribute'
=>
'status'
,
'enum'
=>
Category
::
statuses
(),
'filter'
=>
Category
::
statuses
()
],
// 'status',
// 'status',
// 'created_at',
// 'created_at',
// 'updated_at',
// 'updated_at',
...
...
common/models/Category.php
View file @
64f417aa
...
@@ -49,6 +49,7 @@ class Category extends \yii\db\ActiveRecord
...
@@ -49,6 +49,7 @@ class Category extends \yii\db\ActiveRecord
[[
'name'
,
'slug'
],
'string'
,
'max'
=>
32
],
[[
'name'
,
'slug'
],
'string'
,
'max'
=>
32
],
[[
'description'
],
'string'
,
'max'
=>
512
],
[[
'description'
],
'string'
,
'max'
=>
512
],
[[
'image_url'
,
'image_path'
],
'string'
,
'max'
=>
1024
],
[[
'image_url'
,
'image_path'
],
'string'
,
'max'
=>
1024
],
[[
'image'
],
'safe'
]
];
];
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment