当前位置: 首页>>代码示例>>PHP>>正文


PHP CMS::component_dir方法代码示例

本文整理汇总了PHP中CMS::component_dir方法的典型用法代码示例。如果您正苦于以下问题:PHP CMS::component_dir方法的具体用法?PHP CMS::component_dir怎么用?PHP CMS::component_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMS的用法示例。


在下文中一共展示了CMS::component_dir方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: module_paths

 protected function module_paths($module)
 {
     $component = $this->component;
     $mname = str_replace("Component.{$component}", '', $module);
     $mname = str_replace('.', '/', $mname);
     $component_dir = CMS::component_dir($component);
     if (!$mname) {
         $file = $component_dir . "/{$component}.php";
     } else {
         $file = $component_dir . "/lib{$mname}.php";
     }
     return array($file, preg_replace('{/[^/]+$}', '', $file));
 }
开发者ID:techart,项目名称:tao,代码行数:13,代码来源:Factory.php

示例2: partial_paths

 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;
 }
开发者ID:techart,项目名称:tao,代码行数:16,代码来源:View.php

示例3: lang_messages_for

 protected function lang_messages_for($file, $lang)
 {
     $dir = CMS::site_dir();
     if (strpos($file, $dir) === 0) {
         $rfile = substr($file, strlen($dir));
     } else {
         return false;
     }
     $files = array();
     if (strpos($rfile, 'tao/') === 0) {
         $rfile = substr($rfile, 4);
         $this->add_lang_file_if_exists($files, CMS::tao_path("lang/{$rfile}/{$lang}.php"));
     }
     $components_dir = $this->components_dir();
     if (strpos($file, $components_dir) === 0) {
         $cfile = substr($file, strlen($components_dir));
         if ($m = Core_Regexps::match_with_results('{^/([^/]+)/(.+)$}', $cfile)) {
             $component = $m[1];
             $cfile = $m[2];
             $this->add_lang_file_if_exists($files, CMS::component_dir($component, "app/lang/{$lang}.php"));
             $this->add_lang_file_if_exists($files, CMS::component_dir($component, "lang/{$lang}.php"));
             $this->add_lang_file_if_exists($files, CMS::component_dir($component, "app/lang/{$cfile}/{$lang}.php"));
             $this->add_lang_file_if_exists($files, CMS::component_dir($component, "lang/{$cfile}/{$lang}.php"));
         }
     }
     $this->add_lang_file_if_exists($files, CMS::app_path("lang/{$lang}.php"));
     $this->add_lang_file_if_exists($files, CMS::app_path("lang/{$rfile}/{$lang}.php"));
     if (count($files) == 0) {
         return false;
     }
     $messages = array();
     foreach ($files as $file) {
         $fm = (include $file);
         if (is_array($fm)) {
             $messages = array_merge($messages, $fm);
         }
     }
     if (count($messages) == 0) {
         return false;
     }
     return $messages;
 }
开发者ID:techart,项目名称:tao,代码行数:42,代码来源:Lang.php

示例4: dir

 public function dir($path = '')
 {
     return CMS::component_dir($this->name, $path);
 }
开发者ID:techart,项目名称:tao,代码行数:4,代码来源:Component.php

示例5: run

 public function run(WS_Environment $env)
 {
     if (isset($_SERVER['REQUEST_URI']) && ($uri = $_SERVER['REQUEST_URI'])) {
         if (strpos($uri, '/component-static/') === 0) {
             $uri = substr($uri, 18);
             if ($m = Core_regexps::match_with_results('{^([^/]+)/(.+(css|js|gif|jpg|png))/(\\d+)/$}', $uri)) {
                 $component = $m[1];
                 $file = $m[2];
                 $path = CMS::component_dir($component, $file);
                 if (IO_FS::exists($path)) {
                     Core::load('WS.Adapters');
                     $adapter = WS_Adapters::apache();
                     $adapter->process_response(Net_HTTP::Download($path, true));
                     exit;
                 }
             }
         }
     }
     return $this->application->run($env);
 }
开发者ID:techart,项目名称:tao,代码行数:20,代码来源:Handlers.php


注:本文中的CMS::component_dir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。