示例#1
0
 /**
  * if pass parameter return the property of it, else return value of child
  * @param  [type] $_name [description]
  * @return [type]        [description]
  */
 public function childparam($_name = null)
 {
     if ($_name) {
         return router::get_url_property($_name);
     } else {
         return router::get_url_property($this->child());
     }
 }
示例#2
0
 public function pagnation_config()
 {
     if (preg_match("#^([1-9][0-9]*)\$#", \lib\router::get_url_property('page'), $_page)) {
         $page = intval($_page[1]);
         \lib\router::set_storage('pagnation', $page);
         $this->pagnation['current'] = $page;
         \lib\router::remove_url_property('page');
         if ($page == 1) {
             $redirect = new \lib\redirector(null, true);
             $redirect->url = preg_replace("/\\/page=1/", "", $redirect->url);
             $redirect->redirect();
         }
     }
     if (preg_match("#^(\\d+)\$#", \lib\router::get_url_property('length'), $length)) {
         $this->pagnation_set('length', intval($length[1]));
         $this->pagnation_set('custom_length', true);
         \lib\router::remove_url_property('length');
     }
 }