Browse Source

Fixes #711.

tags/2.0.0-alpha
Qiang Xue 11 years ago
parent
commit
6b41d41fd9
  1. 10
      framework/yii/base/Application.php
  2. 8
      framework/yii/base/Module.php

10
framework/yii/base/Application.php

@ -180,6 +180,16 @@ abstract class Application extends Module
}
/**
* Returns an ID that uniquely identifies this module among all modules within the current application.
* Since this is an application instance, it will always return an empty string.
* @return string the unique ID of the module.
*/
public function getUniqueId()
{
return '';
}
/**
* Runs the application.
* This is the main entrance of an application.
* @return integer the exit status (0 means normal, non-zero values mean abnormal)

8
framework/yii/base/Module.php

@ -192,13 +192,7 @@ abstract class Module extends Component
*/
public function getUniqueId()
{
if ($this instanceof Application) {
return '';
} elseif ($this->module) {
return ltrim($this->module->getUniqueId() . '/' . $this->id, '/');
} else {
return $this->id;
}
return $this->module ? ltrim($this->module->getUniqueId() . '/' . $this->id, '/') : $this->id;
}
/**

Loading…
Cancel
Save