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
e26a9ff4
Commit
e26a9ff4
authored
Feb 06, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
1c375b90
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
4 deletions
+73
-4
Application.php
framework/base/Application.php
+0
-3
UrlManager.php
framework/base/UrlManager.php
+0
-0
Application.php
framework/web/Application.php
+21
-1
UrlManager.php
framework/web/UrlManager.php
+52
-0
No files found.
framework/base/Application.php
View file @
e26a9ff4
...
...
@@ -363,9 +363,6 @@ class Application extends Module
'securityManager'
=>
array
(
'class'
=>
'yii\base\SecurityManager'
,
),
'translator'
=>
array
(
'class'
=>
'yii\i18n\Translator'
,
),
));
}
...
...
framework/base/UrlManager.php
deleted
100644 → 0
View file @
1c375b90
This diff is collapsed.
Click to expand it.
framework/web/Application.php
View file @
e26a9ff4
...
...
@@ -32,11 +32,28 @@ class Application extends \yii\base\Application
*/
public
function
processRequest
()
{
$route
=
isset
(
$_GET
[
'r'
])
?
$_GET
[
'r'
]
:
''
;
$route
=
$this
->
getUrlManager
()
->
parseUrl
(
$this
->
getRequest
())
;
return
$this
->
runAction
(
$route
,
$_GET
);
}
/**
* Returns the request component.
* @return Request the request component
*/
public
function
getRequest
()
{
return
$this
->
getComponent
(
'request'
);
}
/**
* @return UrlManager
*/
public
function
getUrlManager
()
{
return
$this
->
getComponent
(
'urlManager'
);
}
/**
* Registers the core application components.
* @see setComponents
*/
...
...
@@ -50,6 +67,9 @@ class Application extends \yii\base\Application
'response'
=>
array
(
'class'
=>
'yii\web\Response'
,
),
'urlManager'
=>
array
(
'class'
=>
'yii\web\UrlManager'
,
),
));
}
}
framework/web/UrlManager.php
0 → 100644
View file @
e26a9ff4
<?php
/**
* UrlManager class file
*
* @link http://www.yiiframework.com/
* @copyright Copyright © 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace
yii\web
;
use
\yii\base\Component
;
/**
* UrlManager manages the URLs of Yii applications.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class
UrlManager
extends
Component
{
public
$routeVar
=
'r'
;
/**
* Initializes the application component.
*/
public
function
init
()
{
parent
::
init
();
$this
->
processRules
();
}
/**
* Processes the URL rules.
*/
protected
function
processRules
()
{
}
/**
* Parses the user request.
* @param HttpRequest $request the request application component
* @return string the route (controllerID/actionID) and perhaps GET parameters in path format.
*/
public
function
parseUrl
(
$request
)
{
if
(
isset
(
$_GET
[
$this
->
routeVar
]))
return
$_GET
[
$this
->
routeVar
];
else
return
''
;
}
}
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