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


PHP Language::orderBy方法代码示例

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


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

示例1: index

 public function index()
 {
     if (Request::isMethod('get')) {
         $lang = Language::orderBy('id', 'desc')->get();
         return view('admin.language.list', array('langs' => $lang));
     }
     /*
     	When create a language. System will scan in English folder (default language)
     	to get all files avaliable to translate. Then create all new file with same name
     	in English folder
     */
     $data = Request::all();
     $main_folder = base_path() . '/resources/lang/';
     $exist_folder = file_exists($main_folder . $data['code']);
     if ($exist_folder) {
         return 'exist_folder';
     } else {
         mkdir($main_folder . $data['code']);
         // get all file in English and make a new copy same name in new language
         /*$list_files = array_diff(scandir($main_folder.'en'),array('..', '.'));
         		foreach($list_files as $file){ 
         		    fopen($main_folder.$data['code'].'/'.$file, "w");
         		}
         		*/
     }
     $l = new Language();
     $l->name = $data['name'];
     $l->code = $data['code'];
     $l->save();
 }
开发者ID:namcoder,项目名称:Topshare,代码行数:30,代码来源:LanguageController.php

示例2: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  \App\Product $product
  * @return \Illuminate\Http\Response
  */
 public function edit(Product $product)
 {
     $productVariants = Product_variant::where('product_id', $product->product_id)->get();
     $languages = Language::orderBy('order', 'asc')->get();
     $categories = Category::all();
     $discounts = Discount::all();
     $taxes = Tax::all();
     return view('intothesource.webshop.products.edit', compact('product', 'productVariants', 'languages', 'categories', 'discounts', 'taxes'));
 }
开发者ID:intothesource,项目名称:laravel-webshop,代码行数:15,代码来源:ProductController.php

示例3: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  * @return void
  */
 public function compose(View $view)
 {
     // Available languages
     $view->with('languages', $languages = Language::orderBy('name')->get());
     // Available languages but current one
     $appLanguage = app('language');
     $view->with('languagesButCurrent', $languages->filter(function ($l) use($appLanguage) {
         return $l->id != $appLanguage->id;
     }));
     // All languages
     //$view->with('allLanguages', Language::orderBy('name')->withTrashed()->get());
 }
开发者ID:LeandrosilvaDG,项目名称:Wiki,代码行数:18,代码来源:LanguagesComposer.php

示例4: index

 public function index()
 {
     $websiteSettings = \App\Exceptions\Handler::readFile("websiteSettings.json");
     $aboutMe = AboutMe::orderBy('sortorder', 'asc')->get();
     $experiences = Experience::orderBy('dateStart', 'desc')->get();
     $skills = Skills::orderBy('sortorder', 'asc')->get();
     $languages = Language::orderBy('sortorder', 'asc')->get();
     //foreach($languages as $language):
     //dd($language->writeName);
     //endforeach;
     return view('website.aboutme')->with(compact('websiteSettings', 'aboutMe', 'experiences', 'skills', 'languages'));
 }
开发者ID:brunomartins-com,项目名称:Personal-Website-with-Laravel,代码行数:12,代码来源:AboutMeController.php

示例5: showForm

 /**
  * Display a form for saving a resource.
  *
  * @param  string $subtitle Page subtitle.
  * @param  string $action   Form route sufix.
  * @param  string $method   Form method.
  * @return Response
  */
 protected function showForm($subtitle, $action, $method = 'POST')
 {
     view()->share(['languages' => \App\Language::orderBy('name')->withTrashed()->lists('name', 'id'), 'providers' => \App\Provider::orderBy('name')->withTrashed()->lists('name', 'id'), 'role' => \App\Role::orderBy('name')->lists('name', 'id')]);
     return parent::showForm($subtitle, $action, $method);
 }
开发者ID:superdol,项目名称:Wiki,代码行数:13,代码来源:UserController.php

示例6: camposTraduccion

 public function camposTraduccion($id)
 {
     $product = Product::findOrFail($id);
     $languages = Language::orderBy('name', 'asc')->get();
     $arrayLan = null;
     foreach ($languages as $lan) {
         $arrayLan[$lan->id] = ['name' => '', 'description' => ''];
         $langProds = LanguageProduct::where('id_product', $product->id)->where('id_language', $lan->id);
         if ($langProds->count() > 0) {
             $langProds = $langProds->first();
             $arrayLan[$lan->id] = ['name' => $langProds->name, 'description' => $langProds->description];
         }
     }
     return ['arrayLan' => $arrayLan, 'languages' => $languages, 'product' => $product];
 }
开发者ID:serranozafra,项目名称:pruebaHectorSerrano,代码行数:15,代码来源:ProductController.php

示例7: camposTraduccion

 public function camposTraduccion($id)
 {
     $categoria = Category::findOrFail($id);
     $languages = Language::orderBy('name', 'asc')->get();
     $arrayLan = null;
     foreach ($languages as $lan) {
         $arrayLan[$lan->id] = ['name' => ''];
         $langCats = LanguageCategory::where('id_category', $categoria->id)->where('id_language', $lan->id);
         if ($langCats->count() > 0) {
             $langCats = $langCats->first();
             $arrayLan[$lan->id] = ['name' => $langCats->name];
         }
     }
     return ['arrayLan' => $arrayLan, 'languages' => $languages, 'category' => $categoria];
 }
开发者ID:serranozafra,项目名称:pruebaHectorSerrano,代码行数:15,代码来源:CategoryController.php

示例8: index

 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function index()
 {
     $languages = \App\Language::orderBy('name')->get();
     // echo Request::cookie('user_language');
     return view('welcome')->with(compact('languages'));
 }
开发者ID:rogerapras,项目名称:aBillander,代码行数:11,代码来源:WelcomeController.php

示例9: getOrder

 public function getOrder()
 {
     if (!ACL::hasPermission('languages', 'edit')) {
         return redirect(route('languages'))->withErrors(['You don\'t have permission for edit the language.']);
     }
     $languages = Language::orderBy('sortorder', 'ASC')->addSelect('languageId')->addSelect('languageName')->addSelect('flag')->addSelect('sortorder')->get();
     return view('admin.language.order')->with(compact('languages'));
 }
开发者ID:brunomartins-com,项目名称:Personal-Website-with-Laravel,代码行数:8,代码来源:LanguageController.php


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