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


PHP View::exists方法代码示例

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


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

示例1: page

 public function page($page = FALSE)
 {
     if ($locale = Cookie::get('locale')) {
         App::setLocale($locale);
     }
     if (!$page) {
         return Redirect::to(Lang::get('navigation.consumer'), 301);
     }
     $nav = array();
     foreach (['consumer', 'exporter'] as $item) {
         $loc = Lang::get('navigation.' . $item);
         $link = strtolower(str_replace(' ', '-', $loc));
         if ($link == $page) {
             $page = $item;
         }
         $nav[$link] = ucfirst($loc);
     }
     if (!View::exists('layouts.public.' . $page)) {
         App::abort(404);
     }
     $sub_nav = array();
     $view = View::make('layouts.public.' . $page);
     switch ($page) {
         case 'exporter':
             $sub_nav = ['assortment', 'horticulture', 'certification', 'contact'];
             $picturebox = new Picturebox\PictureboxManager();
             $view->with('picturebox', $picturebox);
             break;
     }
     $view->with('sub_nav', $sub_nav);
     return $view->with('nav', $nav);
 }
开发者ID:crobays,项目名称:paging,代码行数:32,代码来源:PageController.php

示例2: action_index

 public function action_index($modelName)
 {
     $model = $this->getClassObject($modelName);
     $columnModel = $model::first();
     Input::flash();
     if (Input::get($modelName) != null && $this->addConditions($model, $modelName)->first() != null) {
         $columnModel = $this->addConditions($model, $modelName)->first();
     }
     if ($columnModel == null) {
         return Redirect::to("/lara_admin/models/{$modelName}/new");
     }
     $columns = $columnModel->columns();
     $sort_options = $this->setOrderOptions($columns);
     $models = $this->addConditions($model, $modelName)->order_by($sort_options["column_order"], $sort_options["sort_direction"])->paginate($model->perPage);
     $request_uri = Request::server("REQUEST_URI");
     $request_uri = preg_replace("/&order=[^&]*/", "", $request_uri);
     if (!preg_match("/\\?/i", Request::server("REQUEST_URI"))) {
         $request_uri .= "?";
     }
     //TODO function getCustomAction
     $name_custom_action = "lara_admin::" . Str::plural(Str::lower($modelName)) . "." . preg_replace("/action_/", "", __FUNCTION__);
     if (View::exists($name_custom_action) != false) {
         $view = View::make($name_custom_action, array("sort_options" => $sort_options, "request_uri" => $request_uri, "modelName" => $modelName, "modelInstance" => $model, "models" => $models, "columns" => $columns));
     } else {
         $view = View::make("lara_admin::models.index", array("sort_options" => $sort_options, "request_uri" => $request_uri, "modelName" => $modelName, "modelInstance" => $model, "models" => $models, "columns" => $columns));
     }
     $this->defaultAttrForLayout($modelName, $view);
     return $this->response_with(array("xml", "json", "csv"), $this->collectionToArray($models->results), true);
 }
开发者ID:robriggen,项目名称:lara_admin,代码行数:29,代码来源:models.php

示例3: view

 /**
  * Makes view
  *
  * @param string $viewName
  * @param array $data
  * @param string $controller
  *
  * @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
  */
 public function view($viewName, array $data = [], $controller = "")
 {
     foreach ($this->beforeRender as $method) {
         $this->{$method}($viewName, $data, $controller);
     }
     \View::share("__siteTitle", $this->title);
     \View::share("__siteDescription", $this->description);
     \View::share("__siteKeywords", $this->keywords);
     \View::share("__bodyId", $this->bodyId);
     \View::share("__bodyClass", $this->bodyClass);
     \View::share("__styles", $this->styles);
     \View::share("__scripts", $this->scripts);
     $rc = new \ReflectionClass($this);
     $className = str_replace(\App::getNamespace() . "Http\\Controllers\\", "", $rc->getName());
     \View::share("__controller", $controller ? $controller : "{$className}::{$viewName}");
     if ($this->viewPrefix) {
         $nbView = $this->viewPrefix . '.' . $viewName;
     } else {
         $nbView = 'controllers.' . str_replace("\\", ".", $className) . '.' . $viewName;
     }
     if (\View::exists($nbView)) {
         $viewName = $nbView;
     }
     if (!empty($this->formData)) {
         if ($this->oldInputHasPriority) {
             $this->request()->session()->flashInput(array_merge($this->formData, $this->request()->old(null, [])));
         } else {
             $this->request()->session()->flashInput($this->request()->old(null, []), $this->formData);
         }
     }
     return view($viewName, $this->viewData, $data);
 }
开发者ID:LazyNewbie,项目名称:boilerplate,代码行数:41,代码来源:RenderableTrait.php

示例4: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  */
 public function show($id)
 {
     // if exist external content then send it to browser, increment views
     $external_content = $this->showPage->checkAndGetContentFromHtmlFile(app('veer')->siteId, $id);
     if (!empty($external_content)) {
         \Veer\Models\Page::where('id', '=', $id)->increment('views');
         return \Response::make($external_content, 200)->header('Content-type', 'text/html');
     }
     $page = $this->showPage->getPage($id, app('veer')->siteId);
     if (!is_object($page)) {
         return Redirect::route('page.index');
     }
     $page->increment('views');
     $page->load(array('images' => function ($q) {
         return $q->orderBy('pivot_id', 'asc');
     }, 'tags', 'attributes', 'downloads', 'userlists', 'user'));
     $page->imagesIds = collect($page->images->getDictionary());
     if ($page->show_comments == 1) {
         $this->showPage->loadComments($page, 'page');
     }
     $paginator_and_sorting = get_paginator_and_sorting();
     $data = array("page" => $page, "subpages" => $this->showPage->withChildPages(app('veer')->siteId, $page->id, $paginator_and_sorting), "parentpages" => $this->showPage->withParentPages(app('veer')->siteId, $page->id, $paginator_and_sorting), "products" => $this->showPage->withProducts(app('veer')->siteId, $page->id, $paginator_and_sorting), "categories" => $this->showPage->withCategories(app('veer')->siteId, $page->id), "template" => $this->template);
     $blade_path = $this->template . '.pages.' . $id;
     $viewLink = $this->template . '.page';
     // page with special design
     if ($page->original == 1 && \View::exists($blade_path)) {
         $viewLink = $blade_path;
     }
     $view = viewx($viewLink, $data);
     $this->view = $view;
     return $view;
 }
开发者ID:artemsk,项目名称:veer-core,代码行数:37,代码来源:PageController.php

示例5: returnShortCodes

 public static function returnShortCodes()
 {
     $tpl = static::returnTpl();
     shortcode::add("gallery", function ($params = null) use($tpl) {
         $default = array('tpl' => "gallery-default");
         $params = array_merge($default, (array) $params);
         if (empty($params['tpl']) || !View::exists($tpl . $params['tpl'])) {
             throw new Exception('Template not found: ' . $tpl . $params['tpl']);
         }
         if (!isset($params['id'])) {
             #return false;
             #return "Error: id of gallery is not defined!";
             throw new Exception('ID of gallery is not defined');
         }
         $gallery_id = $params['id'];
         $gallery = Gallery::where('id', $gallery_id)->first();
         if (!is_object($gallery) || !@$gallery->id) {
             return false;
             #return "Error: gallery #{$gallery_id} doesn't exist!";
         }
         $photos = $gallery->photos;
         if (!$photos->count()) {
             return false;
         }
         #dd($tpl.$params['tpl']);
         #dd(compact($photos));
         #return View::make($tpl.$params['tpl'], compact($photos)); ## don't work
         return View::make($tpl . $params['tpl'], array('photos' => $photos));
     });
 }
开发者ID:Grapheme,项目名称:amway,代码行数:30,代码来源:galleries.controller.php

示例6: getTemplates

 public function getTemplates($slug)
 {
     $view_slug = 'rtclientmanager::angular-templates.' . $slug;
     if (\View::exists($view_slug)) {
         return view($view_slug);
     }
     abort(404);
 }
开发者ID:rtmatt,项目名称:rtclientmanager,代码行数:8,代码来源:ClientManagerAPIController.php

示例7: view

 public function view($view)
 {
     $currentView = 'admin-lte::default.' . $view;
     if (\View::exists($currentView)) {
         return $currentView;
     }
     abort(404);
 }
开发者ID:johnshepherd,项目名称:soa-sentinel,代码行数:8,代码来源:TemplateDefault.php

示例8: showTemplate

 /**
  * Display a listing of emailtemplates
  *
  * @return Response
  */
 public function showTemplate($template)
 {
     // return $template;
     if (View::exists('emails.templates.' . $template)) {
         return View::make('emails.templates.' . $template);
     }
     return "Template does not exist";
 }
开发者ID:arbuuuud,项目名称:gnt-aops,代码行数:13,代码来源:EmailTemplatesController.php

示例9: View

 function __call($name, $arguments)
 {
     $view = new View('page/' . strtolower($name));
     if (!$view->exists()) {
         $view = new View('error/404');
     }
     $this->view->content = $view;
 }
开发者ID:jmhobbs,项目名称:MkLst,代码行数:8,代码来源:page.php

示例10: getPage

 public function getPage($page)
 {
     if (View::exists('documentation.' . $page)) {
         View::share('page', $page);
         $this->layout->content = View::make('documentation.' . $page);
     } else {
         return App::abort(404);
     }
 }
开发者ID:GesJeremie,项目名称:Hammer,代码行数:9,代码来源:DocumentationController.php

示例11: showPage

 public function showPage($page)
 {
     $data['page'] = ucfirst($page);
     if (View::exists('pages/' . $page)) {
         return View::make('pages/' . $page, $data);
     } else {
         return App::abort(404);
     }
 }
开发者ID:KSubedi,项目名称:hostlogin,代码行数:9,代码来源:PageController.php

示例12: view

 /**
  * Load a theme view from themes/{theme name}
  * Folder /themes instead /views loaded on boot from SiteServiceProvider
  * 
  * @return string
  */
 public function view($name, array $data = array())
 {
     $view_name = 'site::' . THEME . '.' . $name;
     // Set to 'default' view if view not found
     if (!\View::exists($view_name)) {
         $view_name_arr = explode('.', $view_name);
         $view_name = str_replace(end($view_name_arr), 'default', $view_name);
     }
     return \View::make($view_name, $data);
 }
开发者ID:pongocms,项目名称:cms,代码行数:16,代码来源:Theme.php

示例13: makeRowPath

 private function makeRowPath($view = null)
 {
     if (!$view) {
         $view = 'default';
     }
     $path = $this->makeViewPath('rows', $view);
     if (!\View::exists($path)) {
         throw new \Mrself\YaF\Exceptions\FormException(['name' => $view], 2);
     }
     return $path;
 }
开发者ID:mrself,项目名称:ya-form,代码行数:11,代码来源:Row.php

示例14: index

 public function index($slug)
 {
     $object = $this->object->join('post_translations as t', 't.post_id', '=', 'posts.id')->select('id', 'slug', 'title', 'content', 'meta_desc')->active()->whereSlug($slug)->first();
     if (!$object) {
         App::abort(404);
     }
     $meta = ['title' => $object->title, 'desc' => $object->meta_desc];
     if (\View::exists('berrier::themes.' . config('berrier.theme.name') . '.custom.' . $slug)) {
         return view('berrier::themes.' . config('berrier.theme.name') . '.custom.' . $slug)->with(compact('object'))->with(compact('meta'));
     }
     return view('berrier::themes.' . config('berrier.theme.name') . '.post')->with(compact('object'))->with(compact('meta'));
 }
开发者ID:wislem,项目名称:berrier,代码行数:12,代码来源:PostFrontController.php

示例15: index

 public function index($slug)
 {
     $post = $this->post->select('id', 'slug', 'title', 'content', 'meta_desc', 'media', 'categories')->active()->whereSlug($slug)->first();
     if (!$post) {
         App::abort(404);
     }
     $meta = ['title' => $post->title, 'desc' => $post->meta_desc];
     if (\View::exists('berrier::themes.' . config('berrier.theme.name') . '.custom.' . $slug)) {
         return view('berrier::themes.' . config('berrier.theme.name') . '.custom.' . $slug)->with(compact('page'))->with(compact('meta'));
     }
     return view('berrier::themes.' . config('berrier.theme.name') . '.post')->with(compact('post'))->with(compact('meta'));
 }
开发者ID:matheusgomes17,项目名称:berrier,代码行数:12,代码来源:PostFrontController.php


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