Exemplo n.º 1
0
 /**
  * 获取模板绝对路径
  *
  * @param string $tpl
  * @return string
  */
 protected function getTplPath($tpl)
 {
     $slash = strpos($tpl, ':');
     if ($slash !== false) {
         $tpl = $slash === 0 ? substr($tpl, 1) : str_replace(':', '/', $tpl);
     } else {
         $controller = App::getController();
         $tpl = strtolower($controller) . '/' . $tpl;
     }
     return $tpl;
 }
Exemplo n.º 2
0
 /**
  * 获取查询参数
  *
  * @param string $target
  *
  * @return array
  */
 protected function get_params($target = "")
 {
     $request = Request::getInstance();
     if ($target == "") {
         $controller = App::getController(true);
         $action = App::getAction(true);
         if ($action != 'index') {
             $target = $controller . '-' . $action;
         } else {
             $target = $controller;
         }
     }
     $params = $request->getQueryData();
     $params = array_merge($params, $this->params);
     array_unshift($params, $target);
     return $params;
 }