summaryrefslogtreecommitdiffstats
path: root/system/core/Router.php
diff options
context:
space:
mode:
authorIban Eguia <admin@razican.com>2012-06-08 23:01:31 +0200
committerIban Eguia <admin@razican.com>2012-06-08 23:01:31 +0200
commit895e98c0f04f1087e8900ce8423ad3210a423770 (patch)
tree6adfe487293df38807084599f1f04157b5531e54 /system/core/Router.php
parent0ed4f63f4268b0c98f549ffd711702fd45a761d0 (diff)
parenta593c69de4ea125c096f611c78dd0839489e7ebd (diff)
Merge remote-tracking branch 'upstream/develop' into new_date
Diffstat (limited to 'system/core/Router.php')
-rwxr-xr-xsystem/core/Router.php30
1 files changed, 16 insertions, 14 deletions
diff --git a/system/core/Router.php b/system/core/Router.php
index 5477fed5d..5bc053045 100755
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -32,8 +32,8 @@
*
* @package CodeIgniter
* @subpackage Libraries
- * @author EllisLab Dev Team
* @category Libraries
+ * @author EllisLab Dev Team
* @link http://codeigniter.com/user_guide/general/routing.html
*/
class CI_Router {
@@ -44,36 +44,42 @@ class CI_Router {
* @var object
*/
public $config;
+
/**
* List of routes
*
* @var array
*/
- public $routes = array();
+ public $routes = array();
+
/**
* List of error routes
*
* @var array
*/
- public $error_routes = array();
+ public $error_routes = array();
+
/**
* Current class name
*
* @var string
*/
- public $class = '';
+ public $class = '';
+
/**
* Current method name
*
* @var string
*/
- public $method = 'index';
+ public $method = 'index';
+
/**
* Sub-directory that contains the requested controller class
*
* @var string
*/
- public $directory = '';
+ public $directory = '';
+
/**
* Default controller (and method if specific)
*
@@ -85,6 +91,8 @@ class CI_Router {
* Constructor
*
* Runs the route mapping function.
+ *
+ * @return void
*/
public function __construct()
{
@@ -211,7 +219,6 @@ class CI_Router {
* input, and sets the current class/method
*
* @param array
- * @param bool
* @return void
*/
protected function _set_request($segments = array())
@@ -428,12 +435,7 @@ class CI_Router {
*/
public function fetch_method()
{
- if ($this->method == $this->fetch_class())
- {
- return 'index';
- }
-
- return $this->method;
+ return ($this->method === $this->fetch_class()) ? 'index' : $this->method;
}
// --------------------------------------------------------------------
@@ -481,7 +483,7 @@ class CI_Router {
$this->set_directory($routing['directory']);
}
- if (isset($routing['controller']) && $routing['controller'] != '')
+ if ( ! empty($routing['controller']))
{
$this->set_class($routing['controller']);
}