當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。