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


PHP App::getLocale方法代碼示例

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


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

示例1: index

 public function index()
 {
     $pages = Page::all();
     $landing = Landing::where('lang', \App::getLocale())->first();
     $universities = University::where('lang', \App::getLocale())->take(9)->get();
     return view('pages.index', ['pages' => $pages, 'landing' => $landing, 'universities' => $universities]);
 }
開發者ID:AbuLoot,項目名稱:unichina,代碼行數:7,代碼來源:PagesController.php

示例2: __construct

 public function __construct()
 {
     switch (\App::getLocale()) {
         case 'ru':
             $this->localeDir = 'ru.';
             break;
         default:
             $this->localeDir = '';
     }
 }
開發者ID:Qeenslet,項目名稱:elite-lara,代碼行數:10,代碼來源:FrontController.php

示例3: page

 /**
  * Show the appropriate view depending on the slug.
  *
  * YOU MAY WANT TO MODIFY THIS
  * Right now it only loads some dummy views.
  *
  * @return Response
  */
 public function page($slug)
 {
     // get the corresponding page for that slug
     $page = Page::findBySlugOrId($slug)->withFakes();
     // if there is such a page
     if ($page && $page->translation_lang == \App::getLocale()) {
         // load the proper template
         return view('page_templates.' . $page->template, ['page' => $page]);
     }
     abort(404);
 }
開發者ID:tahirghori,項目名稱:dick,代碼行數:19,代碼來源:PublicController.php

示例4: __construct

 public function __construct()
 {
     $this->middleware('admin');
     switch (\App::getLocale()) {
         case 'ru':
             $this->localeDir = 'ru.';
             break;
         default:
             $this->localeDir = '';
     }
 }
開發者ID:Qeenslet,項目名稱:elite-lara,代碼行數:11,代碼來源:AdministrationController.php

示例5: question

 public function question(Request $request)
 {
     $this->validate($request, ['title' => 'required|exists:auctions,title', 'question' => 'required']);
     if ($request->input('confirmed')) {
         $auction = Auction::where('title', $request->input('title'))->first();
         $recipient = $auction->seller_id;
         $data = ['sender' => User::find(Auth::user()->id), 'message' => $request->input('question'), 'title' => $request->input('title'), 'recipient' => $recipient];
         Message::ask($data);
         Session::flash('flash_message', trans('messages.question.sent'));
         return redirect(\App::getLocale() . '/art');
     } else {
         return view('auctions.ask_conf')->with('message', $request);
     }
 }
開發者ID:timpressive,項目名稱:art-auction,代碼行數:14,代碼來源:MessageController.php


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