當前位置: 首頁>>代碼示例>>PHP>>正文


PHP View::share方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\View::share方法的典型用法代碼示例。如果您正苦於以下問題:PHP View::share方法的具體用法?PHP View::share怎麽用?PHP View::share使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\View的用法示例。


在下文中一共展示了View::share方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct()
 {
     //$this->beforeFilter(function(){  });
     $this->uriSegment = null;
     $this->modelName = null;
     $this->viewsPath = null;
     $this->resourceId = null;
     if (Route::input('alias') !== null) {
         $this->uriSegment = Route::input('alias');
         $this->viewsPath = File::exists(app_path('views/' . Config::get('reactiveadmin::uri') . '/' . $this->uriSegment)) ? Config::get('reactiveadmin::uri') . '.' . $this->uriSegment : 'reactiveadmin::default';
         $this->modelName = studly_case(str_singular(Route::input('alias')));
         $this->modelWrapper = App::make('model_wrapper');
         $this->modelWrapper->model($this->modelName);
         if (Route::input('id') !== null) {
             $this->resourceId = Route::input('id');
         }
         View::share('config', $this->modelWrapper->getConfig());
         // TODO: refactor this!
         // custom behavior
         switch ($this->uriSegment) {
             case 'settings':
                 View::composer(array('admin.' . $this->viewsPath . '.index'), function ($view) {
                     $view->with('settings', Settings::all());
                 });
                 break;
             default:
                 # code...
                 break;
         }
     }
     View::share('view', $this->uriSegment);
     View::share('model', $this->modelName);
 }
開發者ID:verticalhorizon,項目名稱:reactiveadmin,代碼行數:33,代碼來源:AdminController.php

示例2:

 function __construct()
 {
     // share current route in all views
     View::share('current_url', Route::current()->getPath());
     // share current logged in user details all views
     View::share('current_user', $this->current_user());
 }
開發者ID:KritaMaharjan,項目名稱:expert,代碼行數:7,代碼來源:BaseController.php

示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle(Request $request, Closure $next)
 {
     $uri = $request->route()->getParameter('location');
     $page = Page::findByUri($uri);
     if (!$page) {
         $url = URL::findByLocation($uri);
         // The URL isn't in use or
         // The URL is in use and has a page - the page must not be visible to the current user
         //
         // 404.
         if (!$url || !$url->getPage()->isVisible()) {
             throw new NotFoundHttpException();
         }
         // The url is in use but doesn't have a page.
         // The page must have been deleted.
         //
         // 410.
         throw new GoneHttpException();
     }
     if (Editor::isDisabled() && !$page->isVisible()) {
         throw new NotFoundHttpException();
     }
     if (!$page->url()->is($uri)) {
         return redirect((string) $page->url(), 301);
     }
     $request->route()->setParameter('page', $page);
     Editor::setActivePage($page);
     View::share('page', $page);
     return $next($request);
 }
開發者ID:robbytaylor,項目名稱:boom-core,代碼行數:38,代碼來源:ProcessSiteURL.php

示例4: __construct

 public function __construct()
 {
     //        $this->middleware('auth');
     // Fetch the Site Settings object
     $this->currentModelName = Lang::get('crud.shiaiCategory');
     View::share('currentModelName', $this->currentModelName);
 }
開發者ID:xoco70,項目名稱:KendoOnline,代碼行數:7,代碼來源:ShiaiCategoryController.php

示例5: __construct

 public function __construct()
 {
     $this->middleware('auth');
     // Fetch the Site Settings object
     $this->currentModelName = Lang::get('crud.competitor');
     View::share('currentModelName', $this->currentModelName);
 }
開發者ID:xoco70,項目名稱:KendoOnline,代碼行數:7,代碼來源:CompetitorController.php

示例6: setupLayout

 /**
  * Setup the layout used by the controller.
  *
  * @return void
  */
 protected function setupLayout()
 {
     $this->layout = View::make(Config::get('syntara::views.master'));
     $this->layout->title = 'VietSol CMS';
     $this->layout->breadcrumb = array();
     View::share('siteName', 'VietSol CMS');
 }
開發者ID:parabol,項目名稱:laravel-cms,代碼行數:12,代碼來源:RootController.php

示例7: process

 public function process()
 {
     $this->runSteps();
     View::share('steps', $this->getSteps());
     View::share('currentStage', $this);
     return View::make(INSTALLER_NAMESPACE . '::stage')->render();
 }
開發者ID:thunderclap560,項目名稱:quizkpop,代碼行數:7,代碼來源:Stage.php

示例8: __construct

 public function __construct()
 {
     if (Auth::check()) {
         $groups = Auth::user()->groups();
         $menu = [];
         if (in_array('Administrator', $groups)) {
             $menu[] = ['text' => 'Sales', 'url' => '/sales'];
             $menu[] = ['text' => 'Create Sale', 'url' => '/sales/create'];
             $menu[] = ['text' => 'Admin', 'url' => '/admin'];
         } else {
             if (in_array('Agent', $groups)) {
                 $menu[] = ['text' => 'Create Sale', 'url' => '/sales/create'];
             } else {
                 if (in_array('QC', $groups)) {
                     $menu[] = ['text' => 'Sales', 'url' => '/sales'];
                 }
             }
         }
         $userRepo = new UserRepo();
         $e = $userRepo->findEmployee(Auth::user()->id);
         if ($e) {
             $this->employeeId = $e->id;
         }
         View::share('myData', $e);
         View::share('menu', $menu);
         $id = Input::get('id');
         if ($id) {
             $this->userId = $id;
         } else {
             $this->userId = Auth::user()->id;
         }
     }
 }
開發者ID:arjayads,項目名稱:green-tracker,代碼行數:33,代碼來源:Controller.php

示例9: handle

 /**
  * @param Request $request
  * @param Closure $next
  */
 public function handle($request, Closure $next)
 {
     Lang::setFallback(self::getDefault());
     $setLocale = Session::get('setLocale');
     //flash data
     if (Config::get('app.locale_use_cookie')) {
         if ($setLocale) {
             Session::set('locale', $setLocale);
         }
         if (Session::has('locale')) {
             App::setLocale(Session::get('locale'));
         } else {
             self::autoDetect();
         }
     } else {
         if (Config::get('app.locale_use_url')) {
             if ($setLocale) {
                 self::setLocaleURLSegment($setLocale);
             } else {
                 $lang = self::getLocaleFromURL();
                 if ($lang) {
                     App::setLocale($lang);
                 } else {
                     if ($request->segment(1) != 'locale') {
                         //ignore set-locale URL
                         self::autoDetect();
                         self::setLocaleURLSegment(self::get());
                     }
                 }
             }
         }
     }
     View::share('lang', self::get());
 }
開發者ID:hramose,項目名稱:laravel5-adminLTE-1,代碼行數:38,代碼來源:language.php

示例10: getToolbar

 /**
  * Displays the CMS interface with buttons for add page, settings, etc.
  * Called from an iframe when logged into the CMS.
  * The ID of the page which is being viewed is given as a URL paramater (e.g. /boomscms/editor/toolbar/<page ID>).
  */
 public function getToolbar()
 {
     $page = Page::find($this->request->input('page_id'));
     $toolbarFilename = $this->editor->isEnabled() ? 'toolbar' : 'toolbar_preview';
     View::share(['page' => $page, 'editor' => $this->editor, 'auth' => auth(), 'person' => auth()->user()]);
     return view("boomcms::editor.{$toolbarFilename}");
 }
開發者ID:imanghafoori1,項目名稱:boom-core,代碼行數:12,代碼來源:Editor.php

示例11: __construct

 /**
  * Creates a new DashScheduleController instance.
  *
  * @return \CachetHQ\Cachet\Http\Controllers\DashScheduleController
  */
 public function __construct()
 {
     // TODO: Remove this from DashIncidentController, so it's shared?
     $this->subMenu = ['incidents' => ['title' => trans('dashboard.incidents.incidents'), 'url' => route('dashboard.incidents.index'), 'icon' => 'ion-android-checkmark-circle', 'active' => false], 'schedule' => ['title' => trans('dashboard.schedule.schedule'), 'url' => route('dashboard.schedule.index'), 'icon' => 'ion-android-calendar', 'active' => true]];
     View::share('sub_menu', $this->subMenu);
     View::share('sub_title', trans('dashboard.incidents.title'));
 }
開發者ID:ramirors,項目名稱:Cachet,代碼行數:12,代碼來源:ScheduleController.php

示例12: __construct

 public function __construct()
 {
     $this->beforeFilter('csrf', array('on' => 'post'));
     // This should be moved. Think about a nice location
     View::share('playersMini', app('Metin2CMS\\Services\\HighscoreService')->players());
     View::share('guildsMini', app('Metin2CMS\\Services\\HighscoreService')->guilds());
 }
開發者ID:maxupunk,項目名稱:metin2cms,代碼行數:7,代碼來源:BaseController.php

示例13: index

 public function index()
 {
     View::share(['title' => 'Permission', 'sideBar' => NavigatorHelper::getSideBarBE()]);
     $user = Session::get('user');
     $userRole = $user['role_id'];
     $role = Role::where('id', '!=', 1)->where('id', '!=', $userRole)->get(['id', 'name'])->toArray();
     return view('permission.list')->with(['role' => $role]);
 }
開發者ID:hungnt167,項目名稱:CDShop,代碼行數:8,代碼來源:PermissionController.php

示例14: create

 public function create()
 {
     View::share(['title' => Lang::get('content.create account'), 'sideBar' => NavigatorHelper::getSideBarBE()]);
     $model = new Role();
     //Not display SA
     $role = $model->where('id', '!=', 1)->get();
     return view('account.create', compact('role', $role));
 }
開發者ID:hungnt167,項目名稱:CDShop,代碼行數:8,代碼來源:AccountController.php

示例15: index

 public function index()
 {
     View::share(['title' => 'Product management', 'sideBar' => NavigatorHelper::getSideBarBE()]);
     $type = Type::all(['id', 'name'])->toArray();
     $format = Format_cd::all(['id', 'name'])->toArray();
     $price_groups = Price_group::all(['id', 'name', 'root_price', 'price'])->toArray();
     return view('catalog.product.list')->with(['type' => $type, 'format' => $format, 'price_groups' => $price_groups]);
 }
開發者ID:hungnt167,項目名稱:CDShop,代碼行數:8,代碼來源:ProductController.php


注:本文中的Illuminate\Support\Facades\View::share方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。