コード例 #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);
 }
コード例 #2
0
ファイル: View.php プロジェクト: jixm/Simple-PHP-MVC-Skeleton
 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');
 }
コード例 #3
0
ファイル: DB.php プロジェクト: jixm/Simple-PHP-MVC-Skeleton
 /**
  * 获取数据库连接实例
  * @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);
 }
コード例 #4
0
 public function isShow()
 {
     //xhprof性能分析图片头部不能有输出,所以要屏蔽模版输出
     if (!Y::get('tpShow') || Y::getParams('debug') == 'safe') {
         exit;
     }
 }