Beispiel #1
0
 protected function display($data = array(), $file = '')
 {
     oo::include_file(NFS_BASE_ROOT . 'view.php');
     view::display($data, $file);
 }
Beispiel #2
0
define('CONTROLLER_FOLDER_NAME', 'c');
//项目模型文件夹名称
define('MODEL_FOLDER_NAME', 'm');
//项目模板文件夹名称
define('VIEW_FOLDER_NAME', 'v');
//项目配置文件夹名称
define('CONFIG_FOLDER_NAME', 'cfg');
!defined('APP_DIR') && define('APP_DIR', '');
define('CONTROLLER_ROOT', APP_ROOT . DS . APP_DIR . DS . CONTROLLER_FOLDER_NAME . DS);
define('MODEL_ROOT', APP_ROOT . DS . MODEL_FOLDER_NAME . DS);
define('CONFIG_ROOT', APP_ROOT . DS . APP_DIR . DS . CONFIG_FOLDER_NAME . DS);
define('VIEW_ROOT', APP_ROOT . DS . APP_DIR . DS . VIEW_FOLDER_NAME . DS);
require NFS_BASE_ROOT . 'component.php';
require NFS_BASE_ROOT . 'oo.php';
oo::include_file(NFS_BASE_ROOT . 'func.php');
oo::include_file(NFS_BASE_ROOT . 'controller.php');
oo::base('file')->import(NFS_BASE_ROOT . 'log.php');
oo::base('file')->import(NFS_BASE_ROOT . 'db.php');
class NFS
{
    public static $controller;
    public static $action;
    public static $cfg;
    public static function run()
    {
        self::$controller = $controller = !empty($_REQUEST['c']) ? strtolower($_REQUEST['c']) : DEFAULT_CONTROLLER;
        $ctl = oo::c();
        $resful = '_' . strtolower($_SERVER['REQUEST_METHOD']);
        if (($a = strtolower($_REQUEST['a'])) && method_exists($ctl, $a)) {
            $act = $a;
        } elseif (method_exists($ctl, $resful)) {