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


PHP View::exists方法代码示例

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


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

示例1: renderTheme

 /**
  * @param $theme
  * @param $data
  * @return mixed
  */
 protected function renderTheme($theme, $data)
 {
     $customTemplate = 'blade-pagination/' . $theme;
     if (View::exists($customTemplate)) {
         return View::make($customTemplate, $data)->render();
     }
     return View::make('blade-pagination::' . $theme, $data)->render();
 }
开发者ID:gkreer,项目名称:smgt,代码行数:13,代码来源:Presenter.php

示例2: page

 /**
  * Show default page.
  *
  * @param  string  $slug
  *
  * @return mixed
  */
 protected function page($slug)
 {
     $page = Content::page()->publish()->where('slug', '=', $slug)->firstOrFail();
     $slug = preg_replace('/^_page_\\//', '', $slug);
     if (!View::exists($view = "orchestra/story::pages.{$slug}")) {
         $view = 'orchestra/story::page';
     }
     return Facile::view($view)->with(['page' => $page])->render();
 }
开发者ID:dinghua,项目名称:crm,代码行数:16,代码来源:HomeController.php

示例3: getResponse

 /**
  * {@inheritdoc}
  */
 protected function getResponse($page, $id, $slug)
 {
     $slug = preg_replace('/^_post_\\//', '', $slug);
     if (!View::exists($view = "orchestra/story::posts.{$slug}")) {
         $view = 'orchestra/story::post';
     }
     $data = ['id' => $id, 'page' => $page, 'slug' => $slug];
     return Facile::view($view)->with($data)->render();
 }
开发者ID:dinghua,项目名称:crm,代码行数:12,代码来源:PostController.php

示例4: getView

 public function getView($format)
 {
     // if a custom view is set, we don't have to account for the format and assume
     // that the developer knows what he's doing
     if ($this->customView !== null && View::exists($this->customView)) {
         return $this->customView;
     }
     return $format;
 }
开发者ID:kamyh,项目名称:KBlog,代码行数:9,代码来源:Feed.php

示例5: page

 public function page($slug = 'index')
 {
     $view = implode('/', ['pages', $slug]);
     if (!View::exists($view)) {
         abort(404);
     }
     $locale = App::getLocale();
     $pageInMarkdown = base_path("resources/pages/{$locale}/{$slug}.md");
     $pageInHtml = file_exists($pageInMarkdown) ? (new ParsedownExtra())->text(File::get($pageInMarkdown)) : '';
     return view($view, ['slug' => $slug, 'html' => $pageInHtml]);
 }
开发者ID:Alroniks,项目名称:klimchuk.com,代码行数:11,代码来源:PageController.php

示例6: translateView

 /**
  * Translate view name
  *
  * @param $name
  * @param string $delimiter
  * @return string
  */
 protected function translateView($name, $delimiter = '.')
 {
     $locale = App::getLocale();
     $explodedName = (array) explode($delimiter, $name);
     $replaceable = end($explodedName);
     $replaced = preg_replace("~{$replaceable}(?!.*{$replaceable})~", "{$locale}{$delimiter}{$replaceable}", $name);
     if (View::exists($replaced)) {
         return $replaced;
     }
     return $name;
 }
开发者ID:reshadman,项目名称:hammihan-online,代码行数:18,代码来源:BaseController.php

示例7: getEmailBugLink

 public static function getEmailBugLink(\Exception $exception, $message)
 {
     $lang = App::getLocale();
     $fallbackLang = Config::get('app.fallback_locale');
     $emergencyLang = 'en';
     $translatedMail = "pretty-error-page::mail.{$lang}";
     $fallbackMail = "pretty-error-page::mail.{$fallbackLang}";
     $emergencyMail = "pretty-error-page::mail.{$emergencyLang}";
     $mailView = View::exists($translatedMail) ? $translatedMail : (View::exists($fallbackMail) ? $fallbackMail : $emergencyMail);
     View::share('exception', $exception);
     View::share('message', $message);
     $mailBody = rawurlencode(View::make($mailView)->render());
     $mailRecipient = Config::get('pretty-error-page::recipient');
     return "mailto:{$mailRecipient}?body={$mailBody}";
 }
开发者ID:mscharl,项目名称:pretty-error-page,代码行数:15,代码来源:PrettyErrorPageHelper.php

示例8: render

 public function render($view = '', array $data = array())
 {
     if (count($data) === 0) {
         foreach ($data as $k => $v) {
             $this->data($k, $v);
         }
     }
     if (empty($view) || !View::exists($view)) {
         $view = $this->_view;
     }
     if (View::exists($view)) {
         return View::make($view, $this->viewData)->with('messages', $this->getMessageBag());
     }
     return View::make('noexist', array('message' => 'View <strong>' . $view . '</strong> doesn\'t exist'));
 }
开发者ID:NewwayLibs,项目名称:nw-core,代码行数:15,代码来源:Controller.php

示例9: sendMail

 /**
  * Global method to send an email using the provided data
  *
  * @param array $data
  * @param array $mailingList
  * @param string $baseUrl
  * @param string $htmlTemplate
  * @param string $textTemplate
  * @return bool
  */
 protected function sendMail(array $data, array $mailingList, $baseUrl, $htmlTemplate, $textTemplate)
 {
     if (View::exists($htmlTemplate) && View::exists($textTemplate)) {
         $mailFrom = $this->mailFrom;
         Mail::send(array('html' => $htmlTemplate, 'text' => $textTemplate), $data, function ($message) use($mailingList, $baseUrl, $mailFrom) {
             $message->from($mailFrom);
             $message->subject('Error while using ' . $baseUrl);
             foreach ($mailingList as $emailAddress) {
                 $message->to($emailAddress);
             }
         });
         return true;
     }
     return false;
 }
开发者ID:theconceptstore,项目名称:jwt-api-client,代码行数:25,代码来源:Mailer.php

示例10: matchStaticView

 /**
  * Returns the matching static view for the request (if the file
  * exists), otherwise returns the 404 response.
  *
  * TODO: Review the security of matchStaticView() function. Does
  * the Laravel framework already filter the "Request::path()" or
  * "View::make()" methods, or do we need to filter out possible
  * directory traversal attacks from the "requestPath" variable?
  *
  * @param  array $parameters Optional parameters for the View
  * @param  string $view Render the content with the specific view template
  * @return View
  */
 private function matchStaticView($parameters = array(), $view = null)
 {
     $basePath = rtrim(base_path(), "/");
     $requestPath = rtrim(mb_strtolower(Request::path()), "/");
     $fullStaticViewPath = "{$basePath}/resources/views/pages/{$requestPath}";
     $staticViewFilename = "pages/{$requestPath}";
     if (is_dir($fullStaticViewPath)) {
         $staticViewFilename .= "/index";
     }
     if (View::exists($staticViewFilename)) {
         return View::make($staticViewFilename, $parameters);
     }
     if (isset($view) && View::exists($view)) {
         return View::make($view, $parameters);
     }
     # Otherwise return the 404 response
     return App::abort(404);
 }
开发者ID:NordicHealthData,项目名称:search-portal,代码行数:31,代码来源:PagesController.php

示例11: preview

 public function preview($entity, $id)
 {
     $modelString = 'Yab\\Quarx\\Models\\' . ucfirst($entity);
     if (!class_exists($modelString)) {
         $modelString = 'Yab\\Quarx\\Models\\' . ucfirst($entity) . 's';
     }
     $model = new $modelString();
     $modelInstance = $model->find($id);
     $data = [$entity => $modelInstance];
     $view = 'quarx-frontend::' . $entity . '.show';
     if (!View::exists($view)) {
         $view = 'quarx-frontend::' . $entity . 's.show';
     }
     if ($entity === 'page') {
         $view = 'quarx-frontend::pages.' . $modelInstance->template;
     }
     return view($view, $data);
 }
开发者ID:YABhq,项目名称:Quarx,代码行数:18,代码来源:QuarxFeatureController.php

示例12: getView

 /**
  * Get view name
  * Defaults to the package views unless a custom view is set
  *
  * @param string $format
  *
  * @return void
  */
 public function getView($format)
 {
     // if a custom view is set, we don't have to account for the format and assume
     // that the developer knows what he's doing
     if ($this->customView !== null && View::exists($this->customView)) {
         return $this->customView;
     }
     $packagePrefix = 'feed::';
     // for package's default views, we send the view name with appropriate format
     return $packagePrefix . $format;
 }
开发者ID:phecho,项目名称:laravel-feed,代码行数:19,代码来源:Feed.php

示例13: getView

 /**
  * Get view name
  *
  * @param string $format
  *
  * @return void
  */
 public function getView($format)
 {
     // if a custom view is set
     if ($this->customView !== null && View::exists($this->customView)) {
         return $this->customView;
     }
     // else return default view
     return 'feed::' . $format;
 }
开发者ID:nexana,项目名称:laravel-feed,代码行数:16,代码来源:Feed.php

示例14: getEmbedHtml

 public function getEmbedHtml($height = null, $width = null)
 {
     $viewPrefix = 'boomcms::assets.embed.';
     $assetType = strtolower(class_basename($this->getType()));
     $viewName = View::exists($viewPrefix . $assetType) ? $viewPrefix . $assetType : $viewPrefix . 'default';
     return View::make($viewName, ['asset' => $this, 'height' => $height, 'width' => $width]);
 }
开发者ID:robbytaylor,项目名称:boom-core,代码行数:7,代码来源:Asset.php

示例15: fileExists

 /**
  * @return bool
  */
 public function fileExists()
 {
     return View::exists($this->getFullFilename());
 }
开发者ID:robbytaylor,项目名称:boom-core,代码行数:7,代码来源:Template.php


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