Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
a6961f34
Commit
a6961f34
authored
Jan 26, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patched controller and action creation
parent
debba898
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
Application.php
framework/base/Application.php
+7
-6
Controller.php
framework/base/Controller.php
+3
-2
No files found.
framework/base/Application.php
View file @
a6961f34
...
@@ -211,15 +211,16 @@ class Application extends Module
...
@@ -211,15 +211,16 @@ class Application extends Module
*/
*/
public
function
runController
(
$route
,
$params
=
array
())
public
function
runController
(
$route
,
$params
=
array
())
{
{
$result
=
$this
->
createController
(
$route
);
list
(
$controller
,
$action
)
=
explode
(
'/'
,
$route
);
if
(
$result
===
false
)
{
$controllerObject
=
$this
->
createController
(
$controller
,
$this
);
if
(
$controllerObject
===
false
)
{
throw
new
InvalidRequestException
(
\Yii
::
t
(
'yii'
,
'Unable to resolve the request.'
));
throw
new
InvalidRequestException
(
\Yii
::
t
(
'yii'
,
'Unable to resolve the request.'
));
}
}
/** @var $controller Controller */
list
(
$controller
,
$action
)
=
$result
;
$priorController
=
$this
->
controller
;
$priorController
=
$this
->
controller
;
$this
->
controller
=
$controller
;
$this
->
controller
=
$controller
Object
;
$status
=
$controller
->
run
(
$action
,
$params
);
$status
=
$controller
Object
->
run
(
$action
,
$params
);
$this
->
controller
=
$priorController
;
$this
->
controller
=
$priorController
;
return
$status
;
return
$status
;
}
}
...
...
framework/base/Controller.php
View file @
a6961f34
...
@@ -142,8 +142,9 @@ class Controller extends Component
...
@@ -142,8 +142,9 @@ class Controller extends Component
if
(
$actionID
===
''
)
{
if
(
$actionID
===
''
)
{
$actionID
=
$this
->
defaultAction
;
$actionID
=
$this
->
defaultAction
;
}
}
if
(
isset
(
$this
->
actionMap
[
$actionID
]))
{
$actions
=
$this
->
actions
();
return
\Yii
::
createObject
(
$this
->
actionMap
[
$actionID
],
$actionID
,
$this
);
if
(
isset
(
$actions
[
$actionID
]))
{
return
\Yii
::
createObject
(
$actions
[
$actionID
],
$actionID
,
$this
);
}
elseif
(
method_exists
(
$this
,
'action'
.
$actionID
))
{
}
elseif
(
method_exists
(
$this
,
'action'
.
$actionID
))
{
return
new
InlineAction
(
$actionID
,
$this
);
return
new
InlineAction
(
$actionID
,
$this
);
}
else
{
}
else
{
...
...
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