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
61e93916
Commit
61e93916
authored
Aug 31, 2016
by
dianc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Category Updated
parent
44ccbb66
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
10 deletions
+22
-10
CategoryController.php
backend/modules/theme/controllers/CategoryController.php
+0
-9
_form.php
backend/modules/theme/views/category/_form.php
+1
-1
Category.php
common/models/Category.php
+21
-0
No files found.
backend/modules/theme/controllers/CategoryController.php
View file @
61e93916
...
@@ -25,15 +25,6 @@ class CategoryController extends Controller
...
@@ -25,15 +25,6 @@ class CategoryController extends Controller
'delete'
=>
[
'post'
],
'delete'
=>
[
'post'
],
],
],
],
],
[
'class'
=>
SluggableBehavior
::
className
(),
'attribute'
=>
'name'
,
],
[
'class'
=>
TimestampBehavior
::
className
(),
'createdAtAttribute'
=>
'created_at'
,
'updatedAtAttribute'
=>
'updated_at'
]
];
];
}
}
...
...
backend/modules/theme/views/category/_form.php
View file @
61e93916
...
@@ -33,7 +33,7 @@ use yii\bootstrap\ActiveForm;
...
@@ -33,7 +33,7 @@ use yii\bootstrap\ActiveForm;
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-3"
>
<div
class=
"col-md-3"
>
<?=
$form
->
field
(
$model
,
'image
_url
'
)
->
widget
(
<?=
$form
->
field
(
$model
,
'image'
)
->
widget
(
\trntv\filekit\widget\Upload
::
className
(),
\trntv\filekit\widget\Upload
::
className
(),
[
[
'url'
=>
[
'/file-storage/upload'
],
'url'
=>
[
'/file-storage/upload'
],
...
...
common/models/Category.php
View file @
61e93916
...
@@ -66,6 +66,27 @@ class Category extends \yii\db\ActiveRecord
...
@@ -66,6 +66,27 @@ class Category extends \yii\db\ActiveRecord
];
];
}
}
public
function
behaviors
()
{
return
[
[
'class'
=>
SluggableBehavior
::
className
(),
'attribute'
=>
'name'
,
],
[
'class'
=>
UploadBehavior
::
className
(),
'attribute'
=>
'image'
,
'pathAttribute'
=>
'image_path'
,
'baseUrlAttribute'
=>
'image_url'
,
],
[
'class'
=>
TimestampBehavior
::
className
(),
'createdAtAttribute'
=>
'created_at'
,
'updatedAtAttribute'
=>
'updated_at'
]
];
}
/**
/**
* @return \yii\db\ActiveQuery
* @return \yii\db\ActiveQuery
*/
*/
...
...
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