function foo(name){ this.name=name; // 实例方法 this.GetName=function(){ console.log("my name is "+name); GetId(); } // 内部方法 var GetId = function(){ console.log("I have no id.."); } } // 类方法 foo.SayHi=function(){ console.log("hi!"
当我打开链接:http://localhost/3g/index/open/a/b? from=timeline后,推断链接中的from是否等于timeline,假设等于timeline.那么就调用控制器内部的timeline方法,并加载timeline.php这个模板. class Index extends CI_Controller { function __construct() { parent::__construct(); } public function open($a=0,$