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


PHP Factory::exists方法代码示例

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


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

示例1: getLogin

 /**
  * Displays the login form.
  */
 public function getLogin()
 {
     $viewConfig = $this->config->get('l4-lock::config.lock.views');
     if ($this->view->exists($viewConfig['foot-note'])) {
         $viewConfig['foot-note'] = $this->view->make($viewConfig['foot-note'])->render();
     }
     return $this->view->make($this->config->get('l4-lock::config.lock.views.login'), array('view' => $viewConfig))->render();
 }
开发者ID:codenamegary,项目名称:l4-lock,代码行数:11,代码来源:LockController.php

示例2: template

 /**
  * Return an angular template partial.
  *
  * @param  \App\Http\Requests\Api\Angular\TemplateRequest  $request
  * @return \Illuminate\View\View
  */
 public function template(TemplateRequest $request)
 {
     $template = $request->get('template');
     if ($this->viewFactory->exists($template)) {
         return $this->viewFactory->make($template);
     }
     return $this->response()->errorNotFound();
 }
开发者ID:kevindierkx,项目名称:uuid-namespace-manager,代码行数:14,代码来源:TemplatesController.php

示例3: handle

 /**
  * Handle incoming requests.
  * @param Request $request
  * @param \Closure $next
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function handle($request, Closure $next)
 {
     if ($this->maintenance->isDownMode()) {
         if ($this->view->exists('errors.503')) {
             return new Response($this->view->make('errors.503'), 503);
         }
         return $this->app->abort(503, 'The application is down for maintenance.');
     }
     return $next($request);
 }
开发者ID:vluzrmos,项目名称:lumen-maintenance-mode,代码行数:16,代码来源:MaintenanceModeMiddleware.php

示例4: renderContent

 /**
  * @return mixed
  */
 private function renderContent()
 {
     if (!$this->view->exists($this->template)) {
         $this->getFallBackTemplate();
     }
     return $this->view->make($this->template, $this->data);
 }
开发者ID:coandacms,项目名称:coanda-core,代码行数:10,代码来源:PageRenderer.php

示例5: buildTemplate

 /**
  * Build the template of the control.
  * We check if the assets of the package where published in the views/vendor directory
  * Of the project, if they don not have published in their project's, we check if exists a custom
  * View for the type of control on the package views.
  * If does not exist the view for the control we return the default.
  *
  * @param $type
  * @param $attributes
  * @return string
  */
 public function buildTemplate($type, &$attributes)
 {
     // Path to vendor form builder views.
     $publishedPath = base_path() . '/resources/views/vendor/socieboy/forms/';
     // If the view was published on the project.
     if (File::exists($publishedPath . $type . '.blade.php')) {
         /**
          * If the attributes has a icon we are going to display the
          * view for group controls, other way we just return the custom view.
          */
         if (isset($attributes['icon'])) {
             unset($attributes['icon']);
             return $publishedPath . 'group.blade.php';
         }
         return $publishedPath . $type . '.blade.php';
     } else {
         if ($this->view->exists('FieldBuilder::' . $type)) {
             return 'FieldBuilder::' . $type;
         }
     }
     /**
      * If the attributes has an icon we return the view of the package for group controls.
      */
     if (isset($attributes['icon'])) {
         unset($attributes['icon']);
         return 'FieldBuilder::group';
     }
     /**
      * If the view is in the package and does not have icon we just return the custom view.
      */
     return 'FieldBuilder::default';
 }
开发者ID:socieboy,项目名称:forms,代码行数:43,代码来源:FieldBuilder.php

示例6: render

 /**
  * Render widget to HTML.
  *
  * @throws UnknownWidgetFileException
  * @return string
  */
 public function render()
 {
     if ($this->enable == false) {
         return '';
     }
     $widgetDir = $this->config->get('theme.containerDir.widget');
     $path = $this->theme->getThemeNamespace($widgetDir . '.' . $this->template);
     // If not found in theme widgets directory, try to watch in views/widgets again.
     if ($this->watch === true and !$this->view->exists($path)) {
         $path = $widgetDir . '.' . $this->template;
     }
     // Error file not exists.
     if (!$this->view->exists($path)) {
         throw new UnknownWidgetFileException("Widget view [{$this->template}] not found.");
     }
     $widget = $this->view->make($path, $this->data)->render();
     return $widget;
 }
开发者ID:fajardm,项目名称:theme-manager,代码行数:24,代码来源:Widget.php

示例7: 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

示例8: render

 /**
  * Return a template with content.
  *
  * @param  integer $statusCode
  * @throws UnknownLayoutFileException
  * @return Response
  */
 public function render($statusCode = 200)
 {
     // Fire the event before render.
     $this->fire('after', $this);
     // Flush asset that need to serve.
     $this->asset->flush();
     // Layout directory.
     $layoutDir = $this->getConfig('containerDir.layout');
     $path = $this->getThemeNamespace($layoutDir . '.' . $this->layout);
     if (!$this->view->exists($path)) {
         throw new UnknownLayoutFileException("Layout [{$this->layout}] not found.");
     }
     $content = $this->view->make($path)->render();
     // Append status code to view.
     $content = new Response($content, $statusCode);
     // Having cookie set.
     if ($this->cookie) {
         $content->withCookie($this->cookie);
     }
     return $content;
 }
开发者ID:fajardm,项目名称:theme-manager,代码行数:28,代码来源:Theme.php

示例9: exists

 /**
  * Determine if a given view exists.
  *
  * @param string $view
  * @return bool 
  * @static 
  */
 public static function exists($view)
 {
     return \Illuminate\View\Factory::exists($view);
 }
开发者ID:satriashp,项目名称:tour,代码行数:11,代码来源:_ide_helper.php


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