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
663d3fed
Commit
663d3fed
authored
Apr 02, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added defaultView to ViewAction
parent
96d38820
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
ViewAction.php
framework/web/ViewAction.php
+9
-1
No files found.
framework/web/ViewAction.php
View file @
663d3fed
...
@@ -36,6 +36,14 @@ class ViewAction extends Action
...
@@ -36,6 +36,14 @@ class ViewAction extends Action
public
$viewParam
=
'view'
;
public
$viewParam
=
'view'
;
/**
/**
* @var string the name of the default view when [[\yii\web\ViewAction::$viewParam]] GET parameter is not provided
* by user. Defaults to 'index'. This should be in the format of 'path/to/view', similar to that given in the
* GET parameter.
* @see \yii\web\ViewAction::$viewPrefix
*/
public
$defaultView
=
'index'
;
/**
* @var string a string to be prefixed to the user-specified view name to form a complete view name.
* @var string a string to be prefixed to the user-specified view name to form a complete view name.
* For example, if a user requests for `tutorial/chap1`, the corresponding view name will
* For example, if a user requests for `tutorial/chap1`, the corresponding view name will
* be `pages/tutorial/chap1`, assuming the prefix is `pages`.
* be `pages/tutorial/chap1`, assuming the prefix is `pages`.
...
@@ -111,7 +119,7 @@ class ViewAction extends Action
...
@@ -111,7 +119,7 @@ class ViewAction extends Action
*/
*/
protected
function
resolveViewName
()
protected
function
resolveViewName
()
{
{
$viewName
=
Yii
::
$app
->
request
->
get
(
$this
->
viewParam
);
$viewName
=
Yii
::
$app
->
request
->
get
(
$this
->
viewParam
,
$this
->
defaultView
);
if
(
!
is_string
(
$viewName
)
||
!
preg_match
(
'/^\w[\w\/\-\.]*$/'
,
$viewName
))
{
if
(
!
is_string
(
$viewName
)
||
!
preg_match
(
'/^\w[\w\/\-\.]*$/'
,
$viewName
))
{
if
(
YII_DEBUG
)
{
if
(
YII_DEBUG
)
{
...
...
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