예제 #1
0
파일: Page.php 프로젝트: uedcw/webstory
 public function execute()
 {
     $view = $this->get_view();
     if ($view) {
         $file = "page/" . mpf_classname_to_path(get_class($this)) . $view . ".phtml";
         global $G_LOAD_PATH;
         foreach ($G_LOAD_PATH as $path) {
             if (file_exists($path . $file)) {
                 $this->render($path . $file, TRUE);
                 break;
             }
         }
     }
 }
예제 #2
0
 public function real_component()
 {
     $view = $this->get_view();
     if ($view) {
         $file = "component/" . mpf_classname_to_path(get_class($this)) . $view . '.phtml';
         global $G_LOAD_PATH;
         foreach ($G_LOAD_PATH as $path) {
             if (file_exists($path . $file)) {
                 $this->render($path . $file);
                 break;
             }
         }
     }
 }
예제 #3
0
 /**
  * 本方法在页面模板中调用,负责渲染页面的主题内容。
  * 跟get_view方法并无区别
  */
 public function real_page()
 {
     $view = $this->get_view();
     if ($view) {
         $file = "page/" . mpf_classname_to_path(get_class($this)) . $view . ".phtml";
         global $G_LOAD_PATH;
         foreach ($G_LOAD_PATH as $path) {
             if (file_exists($path . $file)) {
                 // 最终页面模板中已经设置了字符集等信息
                 // 无需再设置
                 $this->render($path . $file, FALSE);
                 break;
             }
         }
     }
 }
예제 #4
0
 /**
  * 载入组件显示页面
  */
 public function execute()
 {
     $view = $this->get_view();
     if ($view) {
         $f = mpf_classname_to_path(get_class($this)) . $view . '.phtml';
         $file = "component/" . $f;
         global $G_LOAD_PATH, $cached_files;
         if (defined('CACHE_PATH')) {
             $cf = mpf_class_to_cache_file($f, "component");
             if (file_exists($cf)) {
                 $this->render($cf);
                 return;
             }
         }
         foreach ($G_LOAD_PATH as $path) {
             if (file_exists($path . $file)) {
                 $this->render($path . $file);
                 if (defined('CACHE_PATH')) {
                     mpf_save_to_cache($f, "component", $path . $file);
                 }
                 break;
             }
         }
     }
 }
예제 #5
0
파일: Debug.php 프로젝트: uedcw/webstory
 public static function use_styles()
 {
     $path = mpf_classname_to_path(__CLASS__);
     return array($path . "Debug.css");
 }