示例#1
0
 function __construct($controller, $action, URL $url = null)
 {
     if (is_null($url)) {
         $url = new URL();
         $url->load();
     }
     $this->controller = $controller;
     $this->action = $action;
     $this->url = $url;
 }
示例#2
0
 function __construct(Request $request, URL $url = null)
 {
     if (is_null($url)) {
         $url = new URL();
         $url->load();
         // Request убивает двоеточия в URL, поэтому используется $_SERVER['REQUEST_URI']
     }
     $this->setRequest($request);
     $this->setUrl($url);
     $this->init();
 }
示例#3
0
 function __construct(URL $url = null, $controllers_path = null)
 {
     if (is_null($url)) {
         $url = new URL();
         $url->load();
     }
     if (!is_null($controllers_path)) {
         $this->setControllersPath($controllers_path);
     }
     $this->setURL($url);
     $this->init();
 }
示例#4
0
文件: parse.php 项目: cmsx/url
 function testConstructor()
 {
     $u1 = new URL('one', 'two', 'three');
     $u2 = new URL();
     $u2->load('one', 'two', 'three');
     $this->assertEquals($u2->toString(), $u1->toString(), 'Конструктор и Load');
 }