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
775604ae
Commit
775604ae
authored
Aug 17, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc fix.
parent
054b6f58
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
Generator.php
framework/yii/gii/generators/controller/Generator.php
+16
-0
No files found.
framework/yii/gii/generators/controller/Generator.php
View file @
775604ae
...
@@ -175,11 +175,17 @@ class Generator extends \yii\gii\Generator
...
@@ -175,11 +175,17 @@ class Generator extends \yii\gii\Generator
return
$actions
;
return
$actions
;
}
}
/**
* @return string the controller class name without the namespace part.
*/
public
function
getControllerClass
()
public
function
getControllerClass
()
{
{
return
Inflector
::
id2camel
(
$this
->
getControllerID
())
.
'Controller'
;
return
Inflector
::
id2camel
(
$this
->
getControllerID
())
.
'Controller'
;
}
}
/**
* @return string the controller ID (without the module ID prefix)
*/
public
function
getControllerID
()
public
function
getControllerID
()
{
{
if
((
$pos
=
strrpos
(
$this
->
controller
,
'/'
))
!==
false
)
{
if
((
$pos
=
strrpos
(
$this
->
controller
,
'/'
))
!==
false
)
{
...
@@ -189,6 +195,9 @@ class Generator extends \yii\gii\Generator
...
@@ -189,6 +195,9 @@ class Generator extends \yii\gii\Generator
}
}
}
}
/**
* @return \yii\base\Module the module that the new controller belongs to
*/
public
function
getModule
()
public
function
getModule
()
{
{
if
((
$pos
=
strpos
(
$this
->
controller
,
'/'
))
!==
false
)
{
if
((
$pos
=
strpos
(
$this
->
controller
,
'/'
))
!==
false
)
{
...
@@ -200,12 +209,19 @@ class Generator extends \yii\gii\Generator
...
@@ -200,12 +209,19 @@ class Generator extends \yii\gii\Generator
return
Yii
::
$app
;
return
Yii
::
$app
;
}
}
/**
* @return string the controller class file path
*/
public
function
getControllerFile
()
public
function
getControllerFile
()
{
{
$module
=
$this
->
getModule
();
$module
=
$this
->
getModule
();
return
$module
->
getControllerPath
()
.
'/'
.
$this
->
getControllerClass
()
.
'.php'
;
return
$module
->
getControllerPath
()
.
'/'
.
$this
->
getControllerClass
()
.
'.php'
;
}
}
/**
* @param string $action the action ID
* @return string the action view file path
*/
public
function
getViewFile
(
$action
)
public
function
getViewFile
(
$action
)
{
{
$module
=
$this
->
getModule
();
$module
=
$this
->
getModule
();
...
...
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