本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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};
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}