Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
a0bdf3da
Commit
a0bdf3da
authored
Apr 27, 2016
by
Shakarim Sapa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Добавлен экшн для редактирования;
- Добавлено отображение для update
parent
9c41dec7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
1 deletion
+70
-1
common/modules/cases/controllers/CasesAdminController.php
common/modules/cases/controllers/CasesAdminController.php
+50
-1
common/modules/cases/views/cases-admin/update.php
common/modules/cases/views/cases-admin/update.php
+20
-0
No files found.
common/modules/cases/controllers/CasesAdminController.php
View file @
a0bdf3da
...
...
@@ -27,6 +27,9 @@ class CasesAdminController extends AdminController {
];
}
/**
* @return array
*/
public
function
behaviors
()
{
return
[
...
...
@@ -39,6 +42,9 @@ class CasesAdminController extends AdminController {
];
}
/**
* @return string
*/
public
function
actionManage
(){
$casesSearchModel
=
new
SearchCoContent
();
$casesDataProvider
=
$casesSearchModel
->
searchByType
(
4
,
Yii
::
$app
->
request
->
queryParams
);
...
...
@@ -100,7 +106,6 @@ class CasesAdminController extends AdminController {
]);
}
/**
* @return string|\yii\web\Response
* @throws \Exception
...
...
@@ -145,6 +150,50 @@ class CasesAdminController extends AdminController {
]);
}
public
function
actionUpdate
(
$id
)
{
$model
=
$this
->
findModel
(
$id
);
Yii
::
$app
->
controller
->
page_title
=
'Редактировать страницу'
;
Yii
::
$app
->
controller
->
breadcrumbs
=
[
[
'Управление контентом'
=>
\yii\helpers\Url
::
toRoute
(
'manage'
)],
$model
->
url
,
];
if
(
Yii
::
$app
->
request
->
isPost
)
{
$transaction
=
Yii
::
$app
->
db
->
beginTransaction
();
try
{
$model
->
attributes
=
Yii
::
$app
->
request
->
post
(
'CoContent'
);
if
(
$model
->
save
())
{
$transaction
->
commit
();
return
$this
->
redirect
([
'manage'
]);
}
}
catch
(
\Exception
$e
)
{
$transaction
->
rollBack
();
throw
$e
;
}
}
return
$this
->
render
(
'update'
,
[
'model'
=>
$model
,
'id'
=>
$model
->
category_id
]);
}
/**
* @param $id
* @return string|\yii\web\Response
* @throws \Exception
*/
public
function
actionCopy
(
$id
)
{
$model
=
$this
->
findModel
(
$id
);
...
...
common/modules/cases/views/cases-admin/update.php
0 → 100644
View file @
a0bdf3da
<?php
use
yii\helpers\Html
;
/* @var $this yii\web\View */
/* @var $model common\modules\content\models\CoContent */
$this
->
title
=
Yii
::
t
(
'content'
,
'Update Co Content'
);
$this
->
params
[
'breadcrumbs'
][]
=
[
'label'
=>
Yii
::
t
(
'content'
,
'Co Contents'
),
'url'
=>
[
'index'
]];
$this
->
params
[
'breadcrumbs'
][]
=
$this
->
title
;
?>
<div
class=
"co-content-update"
>
<?=
$this
->
render
(
'_form'
,
[
'model'
=>
$model
,
'id'
=>
$id
])
?>
</div>
\ No newline at end of file
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