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


PHP current_lang函数代码示例

本文整理汇总了PHP中current_lang函数的典型用法代码示例。如果您正苦于以下问题:PHP current_lang函数的具体用法?PHP current_lang怎么用?PHP current_lang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: show

 public function show($slug, $id)
 {
     $cat = $this->cat->show($id, current_lang());
     $cat_ids = $cat->all_ids();
     $data = ['cat' => $cat, 'posts' => $this->post->get_by_catids($cat_ids)];
     return view('frontend.category', $data);
 }
开发者ID:huudo,项目名称:bds1,代码行数:7,代码来源:CatController.php

示例2: show

 public function show($id, $lang = null)
 {
     $lang = $lang ? $lang : current_lang();
     $item = $this->find($id);
     $item->desc = $item->langs()->where('code', $lang)->first()->pivot;
     return $item;
 }
开发者ID:huudo,项目名称:bds1,代码行数:7,代码来源:RoomRepository.php

示例3: getLast

 public function getLast($number, $lang = null, $columns = ['*'])
 {
     $lang = $lang ? $lang : current_lang();
     return $this->model->with(['langs' => function ($q) use($lang) {
         $q->where('code', $lang);
         $q->select('services_lang.*');
     }])->orderBy('created_at', 'desc')->take($number)->get($columns);
 }
开发者ID:huudo,项目名称:bds1,代码行数:8,代码来源:ServicesRepository.php

示例4: show

 public function show($id)
 {
     $group = $this->menugroup->find($id);
     $args = ['orderby' => 'order', 'order' => 'asc'];
     $items = $this->menu->all($id, current_lang(), $args);
     $data = ['title' => 'Quản lý Menu', 'group' => $group, 'editMenus' => $this->menu->editBackendMenu($items)];
     return view('backend.menu.index', $data);
 }
开发者ID:huudo,项目名称:bds1,代码行数:8,代码来源:MenuGroupController.php

示例5: getAllType

 public function getAllType($type = 'cat', $lang = null)
 {
     $lang = $lang ? $lang : current_lang();
     return $this->model->where('type', $type)->with(['langs' => function ($query) use($lang) {
         $query->where('code', $lang);
         $query->select('cat_desc.*');
     }])->orderBy('order')->paginate(20);
 }
开发者ID:JamesNguyen9x,项目名称:vatc,代码行数:8,代码来源:CatRepository.php

示例6: getParent

 public function getParent($field)
 {
     $item = $this->prent()->first(['id']);
     if (is_null($item)) {
         return 'none';
     }
     return $item->langs()->where('code', current_lang())->first(['id'])->pivot->{$field};
 }
开发者ID:huudo,项目名称:bds1,代码行数:8,代码来源:Tax.php

示例7: getByGroup

 public function getByGroup($menu_id, $lang = null)
 {
     $lang = $lang ? $lang : current_lang();
     return $this->model->where('group_id', $menu_id)->with(['langs' => function ($q) use($lang) {
         $q->where('code', $lang);
         $q->select('menu_desc.*');
     }])->orderBy('order')->get();
 }
开发者ID:JamesNguyen9x,项目名称:vatc,代码行数:8,代码来源:MenuRepository.php

示例8: edit

 public function edit($id)
 {
     $item = $this->room->getEdit($id);
     $convs = $this->roomtype->all('roomconv', current_lang());
     $currconvs = $item->convenients()->lists('id')->toArray();
     $data = ['title' => 'Cập nhật phòng', 'roomtypes' => [0 => 'Loại phòng'] + $this->roomtype->listType('roomtype', 0, true, current_lang()), 'hotels' => [0 => 'Chọn khách sạn'] + $this->hotel->listAll(true, current_lang()), 'item' => $item, 'convs' => $this->roomtype->cat_checklists($convs, 0, $currconvs)];
     return view('backend.room.edit', $data);
 }
开发者ID:huudo,项目名称:bds1,代码行数:8,代码来源:RoomController.php

示例9: edit

 public function edit($id)
 {
     $hotel = $this->hotel->getEdit($id);
     $convs = $this->tax->all('hotelconv', current_lang());
     $curconvs = $hotel->convenients()->lists('id')->toArray();
     $data = ['title' => 'Cập nhật khách sạn', 'countries' => $this->country->all(current_lang(), ['columns' => ['id']]), 'item' => $hotel, 'convs' => $this->tax->cat_checklists($convs, 0, $curconvs)];
     return view('backend.hotel.edit', $data);
 }
开发者ID:huudo,项目名称:bds1,代码行数:8,代码来源:HotelController.php

示例10: show

 public function show($id)
 {
     $group = $this->slider->find($id);
     $args = ['orderby' => 'order', 'order' => 'asc'];
     $items = $this->slide->getByGroup($id, current_lang(), $args);
     $data = ['title' => 'Quản lý Slide', 'group' => $group, 'items' => $items];
     return view('backend.slide.index', $data);
 }
开发者ID:huudo,项目名称:bds1,代码行数:8,代码来源:SliderController.php

示例11: findLang

 public function findLang($id, $lang = null)
 {
     $lang = $lang ? current_lang() : $lang;
     $item = $this->model->find($id);
     if (is_null($item)) {
         throw new NullException('null', 'Không thấy dữ liệu');
     }
     return $item;
 }
开发者ID:JamesNguyen9x,项目名称:vatc,代码行数:9,代码来源:BasicRepository.php

示例12: lang

 /**
  * Changing site language
  *
  * @access   public
  * @param    string
  * @return   void
  */
 public function lang($code = false)
 {
     $code or $code = current_lang('code');
     $url = $this->input->get('redirect', true);
     $url or $url = site_url();
     $this->i18n->change($code);
     redirect($url);
     exit;
 }
开发者ID:bkader,项目名称:CodeIgniter-Extended,代码行数:16,代码来源:Process.php

示例13: show

 public function show($slug, $id)
 {
     //Tăng view
     $post = Post::find($id);
     $post->views++;
     $post->save();
     $data = ['post' => $this->post->show($id, current_lang())];
     return view('frontend.post', $data);
 }
开发者ID:huudo,项目名称:bds1,代码行数:9,代码来源:PostController.php

示例14: edit

 public function edit($id)
 {
     $cats = $this->tax->all('cat', current_lang());
     $post = $this->post->getEdit($id);
     authorize_other('edit_posts', 'edit_others_posts', $post->author_id);
     $currcats = $post->cats()->lists('id')->toArray();
     $data = ['title' => 'Cập nhật bài viết', 'cat_checklists' => $this->tax->cat_checklists($cats, 0, $currcats), 'availtags' => $this->tax->listType('tag'), 'currtags' => $post->tags()->lists('id')->toArray(), 'item' => $post];
     return view('backend.post.edit', $data);
 }
开发者ID:huudo,项目名称:bds1,代码行数:9,代码来源:PostController.php

示例15: testLang

 public function testLang()
 {
     $current_lang = current_lang();
     set_current_lang('bg');
     $new_current_lang = current_lang();
     $this->assertEquals('en', $current_lang);
     $this->assertEquals('bg', $new_current_lang);
     $lang_string_test = _e("Select country", true);
     $this->assertEquals('Избери държава', $lang_string_test);
 }
开发者ID:hyrmedia,项目名称:microweber,代码行数:10,代码来源:LangTest.php


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