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


PHP View::getPath方法代码示例

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


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

示例1: addView

 /**
  * Add a View instance to the Collector
  *
  * @param \Illuminate\View\View $view
  */
 public function addView(View $view)
 {
     $name = $view->getName();
     $path = $view->getPath();
     if (!is_object($path)) {
         if ($path) {
             $path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
         }
         if (substr($path, -10) == '.blade.php') {
             $type = 'blade';
         } else {
             $type = pathinfo($path, PATHINFO_EXTENSION);
         }
     } else {
         $type = get_class($view);
         $path = '';
     }
     if (!$this->collect_data) {
         $params = array_keys($view->getData());
     } else {
         $data = array();
         foreach ($view->getData() as $key => $value) {
             $data[$key] = $this->exporter->exportValue($value);
         }
         $params = $data;
     }
     $this->templates[] = array('name' => $path ? sprintf('%s (%s)', $name, $path) : $name, 'param_count' => count($params), 'params' => $params, 'type' => $type);
 }
开发者ID:drickferreira,项目名称:rastreador,代码行数:33,代码来源:ViewCollector.php

示例2: addView

 /**
  * Add a View instance to the Collector
  *
  * @param \Illuminate\View\View $view
  */
 public function addView(View $view)
 {
     $name = $view->getName();
     $path = $view->getPath();
     if ($path) {
         $path = ltrim(str_replace(base_path(), '', realpath($path)), '/');
     }
     if (substr($path, -10) == '.blade.php') {
         $type = 'blade';
     } else {
         $type = pathinfo($path, PATHINFO_EXTENSION);
     }
     if (!$this->collect_data) {
         $params = array_keys($view->getData());
     } else {
         $data = array();
         foreach ($view->getData() as $key => $value) {
             if (in_array($key, ['__env', 'app', 'errors', 'obLevel', 'currentUser'])) {
                 continue;
             }
             $data[$key] = $this->exportValue($value);
         }
         $params = $data;
     }
     $this->templates[] = array('name' => $path ? sprintf('%s (%s)', $name, $path) : $name, 'param_count' => count($params), 'params' => $params, 'type' => $type);
 }
开发者ID:SmoothPhp,项目名称:laravel-debugbar,代码行数:31,代码来源:ViewCollector.php

示例3:

 /**
  * Get the compiled path of a view.
  *
  * @param View $view
  *
  * @return string
  */
 function get_compiled_path(View $view)
 {
     /** @type CompilerEngine $engine */
     $engine = $view->getEngine();
     /** @type BladeCompiler $compiler */
     $compiler = $engine->getCompiler();
     $path = $view->getPath();
     if ($compiler->isExpired($path)) {
         $compiler->compile($path);
     }
     $compiled = $compiler->getCompiledPath($path);
     return $compiled;
 }
开发者ID:laraish,项目名称:framework,代码行数:20,代码来源:helpers.php

示例4: addView

 /**
  * Add a View instance to the Collector
  *
  * @param \Illuminate\View\View $view
  */
 public function addView(View $view)
 {
     $name = $view->getName();
     $type = pathinfo($view->getPath(), PATHINFO_EXTENSION);
     if (!$this->collect_data) {
         $params = array_keys($view->getData());
     } else {
         $data = array();
         foreach ($view->getData() as $key => $value) {
             if (is_object($value) && method_exists($value, 'toArray')) {
                 $value = $value->toArray();
             }
             $data[$key] = $this->exporter->exportValue($value);
         }
         $params = $data;
     }
     $this->templates[] = array('name' => $name, 'param_count' => count($params), 'params' => $params, 'type' => $type);
 }
开发者ID:nvq247,项目名称:Kxexnxh,代码行数:23,代码来源:ViewCollector.php


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