3.1.2 - 严重 - 未处理
我按照手册定义空模块 class EmptyAction extends Action{
public function index(){
//根据当前模块名来判断要执行那个城市的操作
$cityName = MODULE_NAME;
$this->city($cityName);
}
//注意 city方法 本身是 protected 方法
protected function city($name){
//和$name这个城市相关的处理
echo '当前城市' . $name;
}
}接下来,我们就可以在浏览器里面输入http://serverName/index.php/beijing/
http://serverName/index.php/shanghai/
http://serverName/index.php/shenzhen/
由于系统并不存在beijing、shanghai或者shenzhen模块,因此会定位到空模块(EmptyAction)去执行,会看到依次输出的结果是:
当前城市:beijing
当前城市:shanghai
当前城市:shenzhen
但在后面加带运算符号的参数,空模块就会失效,不知道是不是BUG?
http://serverName/index.php/bei=jing/
http://serverName/index.php/bei+jing/
貌似官方也是这个样子

