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


PHP View::getName方法代码示例

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


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

 /**
  * Add a View instance to the Collector
  *
  * @param \Illuminate\View\View $view
  */
 public function addView(View $view)
 {
     $name = $view->getName();
     if (!$this->collect_data) {
         $this->views[] = $name;
     } else {
         $data = array();
         foreach ($view->getData() as $key => $value) {
             if (is_object($value) and method_exists($value, 'toArray')) {
                 $data[$key] = $value->toArray();
             } else {
                 $data[$key] = $value;
             }
         }
         $this->views[] = $name . ' => ' . $this->formatVar($data);
     }
 }
开发者ID:aaronbullard,项目名称:litmus,代码行数:22,代码来源:ViewCollector.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

示例5: addView

 /**
  * Add a View instance to the Collector
  *
  * @param \Illuminate\View\View $view
  */
 public function addView(View $view)
 {
     $name = $view->getName();
     if (!$this->collect_data) {
         $this->data[$name] = $name;
     } else {
         $data = array();
         foreach ($view->getData() as $key => $value) {
             if (is_object($value)) {
                 if (method_exists($value, 'toArray')) {
                     $data[$key] = $value->toArray();
                 } else {
                     $data[$key] = "Object (" . get_class($value) . ")";
                 }
             } else {
                 $data[$key] = $value;
             }
         }
         $this->data[$name] = $data;
     }
 }
开发者ID:robStack,项目名称:CoDev,代码行数:26,代码来源:ViewCollector.php

示例6: callCreator

 /**
  * Call the creator for a given view.
  *
  * @param  \Illuminate\View\View  $view
  * @return void
  */
 public function callCreator(View $view)
 {
     $this->events->fire('creating: ' . $view->getName(), [$view]);
 }
开发者ID:nix9,项目名称:laracasts,代码行数:10,代码来源:Factory.php

示例7: getOverloadPath

 /**
  * Get the override view path.
  *
  * @param  $view
  * @return null|string
  */
 public function getOverloadPath(View $view)
 {
     /**
      * We can only overload namespaced
      * views right now.
      */
     if (!str_contains($view->getName(), '::')) {
         return null;
     }
     /**
      * Split the view into it's
      * namespace and path.
      */
     list($namespace, $path) = explode('::', $view->getName());
     $path = str_replace('.', '/', $path);
     /**
      * If the module is shorthand
      * then check to see if we have
      * an active module to use for it.
      */
     if ($namespace === 'module' && $this->module) {
         $namespace = $this->module->getNamespace();
     }
     /**
      * If the view is already in
      * the theme then skip it.
      */
     if ($namespace == 'theme' || str_is('*.theme.*', $namespace)) {
         return null;
     }
     /**
      * If the view is a streams view then
      * it's real easy to guess what the
      * override path should be.
      */
     if ($namespace == 'streams') {
         $path = $this->theme->getNamespace('streams/' . $path);
     }
     /**
      * If the view uses a dot syntax namespace then
      * transform it all into the override view path.
      */
     if ($addon = $this->addons->get($namespace)) {
         $path = $this->theme->getNamespace("addons/{$addon->getVendor()}/{$addon->getSlug()}-{$addon->getType()}/" . $path);
     }
     if ($this->view->exists($path)) {
         return $path;
     }
     /**
      * If the view uses a dot syntax namespace then
      * transform it all into the override view path.
      *
      * @deprecated since v3.0.0
      */
     if ($addon) {
         $path = $this->theme->getNamespace("addon/{$addon->getVendor()}/{$addon->getSlug()}-{$addon->getType()}/" . $path);
     }
     if ($this->view->exists($path)) {
         return $path;
     }
     return null;
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:68,代码来源:ViewComposer.php

示例8: callComposer

 /**
  * Call the composer for a given view.
  *
  * @param  Illuminate\View\View  $view
  * @return void
  */
 public function callComposer(View $view)
 {
     $this->events->fire('composing: ' . $view->getName(), array($view));
 }
开发者ID:defra91,项目名称:levecchiecredenze.it,代码行数:10,代码来源:Environment.php


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