Beispiel #1
0
 private static function init_controllor()
 {
     self::$controller = isset($_GET['controller']) ? daddslashes($_GET['controller']) : 'index';
 }
Beispiel #2
0
 private static function init_controllor()
 {
     //初始化控制器,并给予一个默认值
     //self::$controller调用自身类(PC)的$controller变量内的值,$_GET['controller']用于接收传入值,若没有,则用默认值index,isset用于判定是否有值,而其中的函数daddslashes()为function.php内预定义好的函数,用去过滤特殊字符
     self::$controller = isset($_GET['controller']) ? daddslashes($_GET['controller']) : 'index';
 }
Beispiel #3
0
 private static function init_controller()
 {
     self::$controller = empty($_GET['controller']) ? "index" : addslashes_modified($_GET['controller']);
 }
Beispiel #4
0
 private static function init_controller()
 {
     self::$controller = isset($_GET['controller']) ? $_GET['controller'] : 'index';
 }