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


PHP Factory::getFinder方法代码示例

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


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

示例1: compile

 /**
  * Compile the view at the given path.
  *
  * @param  string  $path
  * @return void
  */
 public function compile($path)
 {
     // View finder.
     $finder = $this->view->getFinder();
     // Get the list of view paths from the app.
     $paths = $finder->getPaths();
     // Get hints.
     $hints = $finder->getHints();
     // Get current theme uses.
     $currentThemeUses = \Theme::getThemeNamespace();
     if (isset($hints[$currentThemeUses])) {
         $paths = array_merge($paths, $hints[$currentThemeUses]);
     }
     // Get the directory the requested view sits in.
     $viewdir = dirname($path);
     // Match it to a view path registered in config::view.paths
     foreach ($paths as $dir) {
         if (stristr($viewdir, $dir)) {
             $path = str_replace($dir . '/', '', $path);
             break;
         }
     }
     // Create a loader for this template.
     $loader = new Twig_Loader_Filesystem($paths);
     // Instance compiler.
     $twig = $this->getTwigCompiler($loader);
     return $twig->render($path, $this->data);
 }
开发者ID:bokbok123,项目名称:ORS,代码行数:34,代码来源:TwigCompiler.php

示例2: __construct

 public function __construct(Request $request, Factory $factory)
 {
     $this->request = $request;
     $this->view_path = realpath(base_path('resources/views'));
     $this->factory = $factory;
     $this->finder = $factory->getFinder();
     $this->finder->addExtension('schema.php');
 }
开发者ID:leeduc,项目名称:json-api-builder,代码行数:8,代码来源:Generate.php

示例3: __construct

 public function __construct(Request $request, Factory $factory, array $data, $sources = [], $meta = [])
 {
     $this->request = $request;
     $this->data = $data;
     $this->sources = $sources;
     $this->factory = $factory;
     $this->finder = $factory->getFinder();
     if ($meta) {
         $this->data['jsonapi'] = array_filter($meta);
     }
 }
开发者ID:leeduc,项目名称:json-api-builder,代码行数:11,代码来源:Parse.php

示例4: getNormalizedName

 /**
  * Get the normalized name, for creator/composer events
  *
  * @param  \Illuminate\View\Factory $viewEnvironment
  * @return string
  */
 protected function getNormalizedName($viewEnvironment)
 {
     $paths = $viewEnvironment->getFinder()->getPaths();
     $name = $this->getTemplateName();
     // Replace absolute paths, trim slashes, remove extension
     $name = str_replace($paths, '', $name);
     $name = ltrim($name, '/');
     if (substr($name, -5, 5) === '.twig') {
         $name = substr($name, 0, -5);
     }
     return $name;
 }
开发者ID:hushulin,项目名称:laratwig,代码行数:18,代码来源:Template.php

示例5: loadTheme

 /**
  * Load a theme
  *
  * @param string $theme
  * @throws \Exception
  */
 private function loadTheme($theme)
 {
     if (!isset($theme)) {
         return;
     }
     $th = $this->findThemeByDirectory($theme);
     if (isset($th)) {
         $viewFinder = $this->view->getFinder();
         $viewFinder->prependPath($th->getPath());
         if (!is_null($th->getParent())) {
             $this->loadTheme($th->getParent());
         }
         $this->activeTheme = $theme;
     }
 }
开发者ID:lukeed,项目名称:lumen-theme,代码行数:21,代码来源:Theme.php

示例6: getSections

 private function getSections($parent)
 {
     $sections = [];
     if (!$this->view->exists($parent)) {
         $this->warn("Could not find view: {$parent}");
         return $sections;
     }
     $path = $this->view->getFinder()->find($parent);
     $content = $this->file->get($path);
     if (preg_match_all('/\\B@(\\w+)([ \\t]*)(\\( ( (?>[^()]+) | (?3) )* \\))?/x', $content, $matches)) {
         for ($i = 0; $i < count($matches[1]); $i++) {
             if ($matches[1][$i] == 'yield') {
                 $sections[] = $matches[4][$i];
             }
         }
     }
     return $sections;
 }
开发者ID:maddhatter,项目名称:laravel-view-generator,代码行数:18,代码来源:MakeViewCommand.php

示例7: getFinder

 /**
  * Get the view finder instance.
  *
  * @return \Illuminate\View\ViewFinderInterface 
  * @static 
  */
 public static function getFinder()
 {
     return \Illuminate\View\Factory::getFinder();
 }
开发者ID:satriashp,项目名称:tour,代码行数:10,代码来源:_ide_helper.php

示例8: location

 /**
  * Find view location.
  *
  * @param  boolean $realpath
  * @return string
  */
 public function location($realpath = false)
 {
     if ($this->view->exists($this->content)) {
         return $realpath ? $this->view->getFinder()->find($this->content) : $this->content;
     }
 }
开发者ID:fajardm,项目名称:theme-manager,代码行数:12,代码来源:Theme.php

示例9: getViewHints

 /**
  * @return array
  */
 public function getViewHints()
 {
     return $this->view->getFinder()->getHints();
 }
开发者ID:darrengopower,项目名称:framework,代码行数:7,代码来源:FileFinder.php


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