Пример #1
0
 private function __construct($array)
 {
     $this->template = FN::server('template', $this->_link);
     if (defined('FN_WEB_PATH')) {
         //如果是web访问,传递路径变量
         $this->template->assign('url', FN_WEB_PATH);
         if ($this->dir) {
             $this->template->assign('dir', $this->dir);
             $this->template->assign('static', FN_WEB_PATH . 'static/' . $this->dir);
         } else {
             $this->template->assign('static', FN_WEB_PATH . 'static/');
         }
     }
     $this->ajax = FNbase::isAJAX();
     $this->param = empty($array['param']) ? array() : $array['param'];
     $this->default = $array;
     $this->_init();
     $this->_view(empty($this->default['view']) ? '' : $this->default['view']);
 }
Пример #2
0
 private function __construct($array, $class)
 {
     $this->classname = $class;
     $this->controllname = call_user_func_array(array($this->classname, 'getControllName'), array());
     $this->template = FN::server('template', $this->_link);
     if (defined('FN_WEB_PATH')) {
         //如果是web访问,传递路径变量
         $web_path = FN::getConfig('global/web_path');
         if (!$web_path) {
             $web_path = FN_WEB_PATH;
         }
         $this->template->assign('url', $web_path);
         $this->template->assign('static', $web_path . 'static/');
     }
     $this->action = empty($array['action']) ? '' : $array['action'];
     $this->param = empty($array['param']) ? array() : $array['param'];
     $_POST = FNbase::setEscape($_POST);
     $this->param = array_merge($this->param, $_POST);
     $this->ajax = FNbase::isAJAX();
     $this->_init_before($this->action);
     $this->_init($this->action);
     $result = $this->_view($this->action);
     $this->_view_after($result);
 }