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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
0522f9bb
Commit
0522f9bb
authored
May 21, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced id2camel with direct implementation
parent
da397796
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
Controller.php
yii/base/Controller.php
+1
-2
Module.php
yii/base/Module.php
+1
-2
No files found.
yii/base/Controller.php
View file @
0522f9bb
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
namespace
yii\base
;
namespace
yii\base
;
use
Yii
;
use
Yii
;
use
yii\helpers\StringHelper
;
/**
/**
* Controller is the base class for classes containing controller logic.
* Controller is the base class for classes containing controller logic.
...
@@ -226,7 +225,7 @@ class Controller extends Component
...
@@ -226,7 +225,7 @@ class Controller extends Component
if
(
isset
(
$actionMap
[
$id
]))
{
if
(
isset
(
$actionMap
[
$id
]))
{
return
Yii
::
createObject
(
$actionMap
[
$id
],
$id
,
$this
);
return
Yii
::
createObject
(
$actionMap
[
$id
],
$id
,
$this
);
}
elseif
(
preg_match
(
'/^[a-z0-9\\-_]+$/'
,
$id
))
{
}
elseif
(
preg_match
(
'/^[a-z0-9\\-_]+$/'
,
$id
))
{
$methodName
=
'action'
.
StringHelper
::
id2camel
(
$id
);
$methodName
=
'action'
.
str_replace
(
' '
,
''
,
ucwords
(
implode
(
' '
,
explode
(
'-'
,
$id
)))
);
if
(
method_exists
(
$this
,
$methodName
))
{
if
(
method_exists
(
$this
,
$methodName
))
{
$method
=
new
\ReflectionMethod
(
$this
,
$methodName
);
$method
=
new
\ReflectionMethod
(
$this
,
$methodName
);
if
(
$method
->
getName
()
===
$methodName
)
{
if
(
$method
->
getName
()
===
$methodName
)
{
...
...
yii/base/Module.php
View file @
0522f9bb
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
namespace
yii\base
;
namespace
yii\base
;
use
Yii
;
use
Yii
;
use
yii\helpers\StringHelper
;
/**
/**
* Module is the base class for module and application classes.
* Module is the base class for module and application classes.
...
@@ -609,7 +608,7 @@ abstract class Module extends Component
...
@@ -609,7 +608,7 @@ abstract class Module extends Component
if
(
isset
(
$this
->
controllerMap
[
$id
]))
{
if
(
isset
(
$this
->
controllerMap
[
$id
]))
{
$controller
=
Yii
::
createObject
(
$this
->
controllerMap
[
$id
],
$id
,
$this
);
$controller
=
Yii
::
createObject
(
$this
->
controllerMap
[
$id
],
$id
,
$this
);
}
elseif
(
preg_match
(
'/^[a-z0-9\\-_]+$/'
,
$id
))
{
}
elseif
(
preg_match
(
'/^[a-z0-9\\-_]+$/'
,
$id
))
{
$className
=
StringHelper
::
id2camel
(
$id
)
.
'Controller'
;
$className
=
str_replace
(
' '
,
''
,
ucwords
(
implode
(
' '
,
explode
(
'-'
,
$id
)))
)
.
'Controller'
;
$classFile
=
$this
->
controllerPath
.
DIRECTORY_SEPARATOR
.
$className
.
'.php'
;
$classFile
=
$this
->
controllerPath
.
DIRECTORY_SEPARATOR
.
$className
.
'.php'
;
if
(
!
is_file
(
$classFile
))
{
if
(
!
is_file
(
$classFile
))
{
return
false
;
return
false
;
...
...
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