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
71b55384
Commit
71b55384
authored
Sep 01, 2016
by
Junaid Rahman pv
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/development' into development
parents
8314fbdf
7c1c89be
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
26 deletions
+41
-26
CategoryController.php
backend/modules/theme/controllers/CategoryController.php
+11
-10
CategorySearch.php
backend/modules/theme/models/search/CategorySearch.php
+1
-1
create.php
backend/modules/theme/views/category/create.php
+2
-4
index.php
backend/modules/theme/views/category/index.php
+2
-2
layout.php
backend/modules/theme/views/category/layout.php
+21
-6
update.php
backend/modules/theme/views/category/update.php
+4
-3
No files found.
backend/modules/theme/controllers/CategoryController.php
View file @
71b55384
...
@@ -62,19 +62,18 @@ class CategoryController extends Controller
...
@@ -62,19 +62,18 @@ class CategoryController extends Controller
*/
*/
public
function
actionCreate
()
public
function
actionCreate
()
{
{
$model
=
new
Category
();
$this
->
layout
=
'@backend/modules/theme/views/category/layout.php'
;
$this
->
layout
=
'@backend/modules/theme/views/category/layout.php'
;
// $model->scenario =
$model
=
new
Category
();
$model
->
status
=
$model
::
STATUS_ACTIVE
;
$model
->
status
=
$model
::
STATUS_ACTIVE
;
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
())
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
())
{
return
$this
->
redirect
([
'view'
,
'id'
=>
$model
->
id
]);
return
$this
->
redirect
([
'view'
,
'id'
=>
$model
->
id
]);
}
else
{
return
$this
->
render
(
'create'
,
[
'model'
=>
$model
,
]);
}
}
return
$this
->
render
(
'create'
,
[
'model'
=>
$model
,
]);
}
}
/**
/**
...
@@ -85,15 +84,17 @@ class CategoryController extends Controller
...
@@ -85,15 +84,17 @@ class CategoryController extends Controller
*/
*/
public
function
actionUpdate
(
$id
)
public
function
actionUpdate
(
$id
)
{
{
$this
->
layout
=
'@backend/modules/theme/views/category/layout.php'
;
$model
=
$this
->
findModel
(
$id
);
$model
=
$this
->
findModel
(
$id
);
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
())
{
if
(
$model
->
load
(
Yii
::
$app
->
request
->
post
())
&&
$model
->
save
())
{
return
$this
->
redirect
([
'view'
,
'id'
=>
$model
->
id
]);
return
$this
->
redirect
([
'view'
,
'id'
=>
$model
->
id
]);
}
else
{
return
$this
->
render
(
'update'
,
[
'model'
=>
$model
,
]);
}
}
return
$this
->
render
(
'update'
,
[
'model'
=>
$model
,
]);
}
}
/**
/**
...
...
backend/modules/theme/models/search/CategorySearch.php
View file @
71b55384
...
@@ -18,7 +18,7 @@ class CategorySearch extends Category
...
@@ -18,7 +18,7 @@ class CategorySearch extends Category
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'id'
,
'status'
,
'
created_at'
,
'
updated_at'
],
'integer'
],
[[
'id'
,
'status'
,
'updated_at'
],
'integer'
],
[[
'name'
,
'slug'
,
'description'
,
'image_url'
,
'image_path'
],
'safe'
],
[[
'name'
,
'slug'
,
'description'
,
'image_url'
,
'image_path'
],
'safe'
],
];
];
}
}
...
...
backend/modules/theme/views/category/create.php
View file @
71b55384
<?php
<?php
use
yii\helpers\Html
;
/* @var $this yii\web\View */
/* @var $this yii\web\View */
/* @var $model common\models\Category */
/* @var $model common\models\Category */
$this
->
params
[
'categoryId'
]
=
false
;
$this
->
title
=
Yii
::
t
(
'backend'
,
'Create {modelClass}'
,
[
$this
->
title
=
Yii
::
t
(
'backend'
,
'Create {modelClass}'
,
[
'modelClass'
=>
'Category'
,
'modelClass'
=>
'Category'
,
]);
]);
$this
->
params
[
'breadcrumbs'
][]
=
[
'label'
=>
Yii
::
t
(
'backend'
,
'Categories'
),
'url'
=>
[
'index'
]];
$this
->
params
[
'breadcrumbs'
][]
=
[
'label'
=>
Yii
::
t
(
'backend'
,
'Categories'
),
'url'
=>
[
'index'
]];
$this
->
params
[
'breadcrumbs'
][]
=
$this
->
title
;
$this
->
params
[
'breadcrumbs'
][]
=
$this
->
title
;
?>
?>
<div
class=
"category-create"
>
<div
class=
"category-create"
>
<?=
$this
->
render
(
'_form'
,
[
<?=
$this
->
render
(
'_form'
,
[
...
...
backend/modules/theme/views/category/index.php
View file @
71b55384
...
@@ -40,11 +40,11 @@ $this->params['breadcrumbs'][] = $this->title;
...
@@ -40,11 +40,11 @@ $this->params['breadcrumbs'][] = $this->title;
'enum'
=>
Category
::
statuses
(),
'enum'
=>
Category
::
statuses
(),
'filter'
=>
Category
::
statuses
()
'filter'
=>
Category
::
statuses
()
],
],
'status'
,
'created_at'
,
'created_at'
,
// 'updated_at',
// 'updated_at',
[
'class'
=>
'yii\grid\ActionColumn'
],
[
'class'
=>
'yii\grid\ActionColumn'
,
'template'
=>
'{update}{delete}'
],
],
],
]);
?>
]);
?>
...
...
backend/modules/theme/views/category/layout.php
View file @
71b55384
<?php
<?php
use
yii\widgets\Menu
;
use
yii\widgets\Menu
;
use
common\models\Category
;
/* @var $this yii\web\View */
/* @var $this yii\web\View */
?>
?>
<?php
$this
->
beginContent
(
'@backend/views/layouts/main.php'
);
?>
<?php
$this
->
beginContent
(
'@backend/views/layouts/main.php'
);
?>
<?=
<?=
Menu
::
widget
([
Menu
::
widget
([
'items'
=>
[
'items'
=>
[
[
'label'
=>
'Info'
,
'url'
=>
[
'category/create'
]],
[
[
'label'
=>
'Files'
,
'url'
=>
[
'category/update'
,
'id'
=>
''
]],
'label'
=>
'Info'
,
'url'
=>
$this
->
params
[
'categoryId'
]
?
[
'category/update'
,
'id'
=>
$this
->
params
[
'categoryId'
]
]
:
[
'category/create'
],
],
[
'label'
=>
'Files'
,
'url'
=>
$this
->
params
[
'categoryId'
]
?
[
'category/files'
,
'category_id'
=>
$this
->
params
[
'categoryId'
]
]
:
'#'
,
'options'
=>
[
'class'
=>
$this
->
params
[
'categoryId'
]
?
''
:
'disabled'
]
],
],
],
'options'
=>
[
'options'
=>
[
'class'
=>
'nav nav-tabs'
,
'class'
=>
'nav nav-tabs'
,
...
@@ -21,7 +33,10 @@ Menu::widget([
...
@@ -21,7 +33,10 @@ Menu::widget([
]);
]);
?>
?>
<div
id=
"myTabContent"
class=
"tab-content"
>
<div
class=
"tab-content"
>
<?php
echo
$content
?>
<?=
$content
?>
</div>
</div>
<?php
$this
->
endContent
();
?>
<?php
$this
->
endContent
();
?>
backend/modules/theme/views/category/update.php
View file @
71b55384
<?php
<?php
use
yii\helpers\Html
;
/* @var $this yii\web\View */
/* @var $this yii\web\View */
/* @var $model common\models\Category */
/* @var $model common\models\Category */
$this
->
params
[
'categoryId'
]
=
$model
->
id
;
$this
->
title
=
Yii
::
t
(
'backend'
,
'Update {modelClass}: '
,
[
$this
->
title
=
Yii
::
t
(
'backend'
,
'Update {modelClass}: '
,
[
'modelClass'
=>
'Category'
,
'modelClass'
=>
'Category'
,
])
.
' '
.
$model
->
name
;
])
.
' '
.
$model
->
name
;
$this
->
params
[
'breadcrumbs'
][]
=
[
'label'
=>
Yii
::
t
(
'backend'
,
'Categories'
),
'url'
=>
[
'index'
]];
$this
->
params
[
'breadcrumbs'
][]
=
[
'label'
=>
Yii
::
t
(
'backend'
,
'Categories'
),
'url'
=>
[
'index'
]];
$this
->
params
[
'breadcrumbs'
][]
=
[
'label'
=>
$model
->
name
,
'url'
=>
[
'view'
,
'id'
=>
$model
->
id
]];
$this
->
params
[
'breadcrumbs'
][]
=
[
'label'
=>
$model
->
name
,
'url'
=>
[
'view'
,
'id'
=>
$model
->
id
]];
$this
->
params
[
'breadcrumbs'
][]
=
Yii
::
t
(
'backend'
,
'Update'
);
$this
->
params
[
'breadcrumbs'
][]
=
Yii
::
t
(
'backend'
,
'Update'
);
?>
?>
<div
class=
"category-update"
>
<div
class=
"category-update"
>
<?=
$this
->
render
(
'_form'
,
[
<?=
$this
->
render
(
'_form'
,
[
...
...
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