当前位置: 首页>>代码示例>>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;未经允许,请勿转载。