Example #1
0
 public function __construct($path)
 {
     Y::has('defaultMoude') && (self::$module = Y::get('defaultModule'));
     Y::has('defaultController') && (self::$control = Y::get('defaultController'));
     Y::has('defaultAction') && (self::$action = Y::get('defaultAction'));
     $this->parseRoute($path);
 }
Example #2
0
 public function getTemplateFile($template = '')
 {
     $file = Y::getControl();
     if ($template) {
         if (strpos($template, 'Views') != false) {
             return $template;
         }
         $file .= $template;
     } else {
         $file .= Y::getAction();
     }
     return $this->path . $file . '.' . Y::get('ext');
 }
Example #3
0
 /**
  * 获取数据库连接实例
  * @author jixm 
  * @date   2015-10-19
  * @param  [type]     $name mysql配置项名
  * @param  [type]     $type 类型mysql,pdo 或者mysqli
  * @return [type]           [description]
  */
 public static function getInstance($name, $type)
 {
     $dbConfig = Y::get($type . '_' . $name);
     return F::getInstance('Db\\' . $type, $dbConfig);
 }
Example #4
0
 public function isShow()
 {
     //xhprof性能分析图片头部不能有输出,所以要屏蔽模版输出
     if (!Y::get('tpShow') || Y::getParams('debug') == 'safe') {
         exit;
     }
 }