コード例 #1
0
ファイル: View.php プロジェクト: techart/tao
 public function partial_paths($paths = array(), $base_name = '')
 {
     $paths = parent::partial_paths($paths, $base_name);
     if ($this->current_helper instanceof Templates_HelperInterface) {
         $cname = CMS::get_component_name_for($this->current_helper);
         if ($cname) {
             $component_paths = array();
             foreach (array('app/views', 'views') as $v) {
                 $component_paths[] = rtrim(CMS::component_dir($cname, $v), '/');
             }
             $paths = array_merge($component_paths, $paths);
         }
     }
     $paths = array_merge(array(CMS::current_component_dir('app/views'), CMS::current_component_dir('views')), $paths);
     return $paths;
 }
コード例 #2
0
ファイル: FrontTable.php プロジェクト: techart/tao
 protected function templates_dir()
 {
     return CMS::current_component_dir('views');
 }
コード例 #3
0
ファイル: Table.php プロジェクト: techart/tao
 public function redefined_template($template)
 {
     if (!Core_Regexps::match('{\\.phtml$}', $template)) {
         $template .= '.phtml';
     }
     if ($template[0] == '.' || $template[0] == '/') {
         return $template;
     }
     $dir = $this->templates_dir();
     if ($dir && is_file("{$dir}/{$template}")) {
         return "{$dir}/{$template}";
     }
     $dir = CMS::current_component_dir('views/admin');
     if (is_file("{$dir}/{$template}")) {
         return "{$dir}/{$template}";
     }
     return false;
 }