本文整理汇总了PHP中L::get_admin方法的典型用法代码示例。如果您正苦于以下问题:PHP L::get_admin方法的具体用法?PHP L::get_admin怎么用?PHP L::get_admin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类L
的用法示例。
在下文中一共展示了L::get_admin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetSetAdminWorks
public function testGetSetAdminWorks()
{
$lingua = "l";
L::set_admin($lingua);
$check_lingua = L::get_admin();
$this->assertEquals($check_lingua, $lingua);
}
示例2: get_cat_select_arr
function get_cat_select_arr($with_empty_field = false)
{
$cat_arr = $with_empty_field ? ["0" => ""] : [];
Category::whereLang(L::get_admin())->get(["id", "description"])->each(function ($cat) use(&$cat_arr) {
$cat_arr[$cat->id] = $cat->description;
});
return $cat_arr;
}
示例3: get_form_select_lang
function get_form_select_lang($is_admin = 1)
{
$form = Form::open(["method" => "post", "action" => 'Palmabit\\Multilanguage\\Controllers\\LangController@swapLang', "id" => "form-select-lang"]);
// prelievo dati per la lingua
$lang_list = Config::get('multilanguage::lang_list');
$current_lang = $is_admin ? L::get_admin() : L::get();
// select language
$form .= Form::label("lang", "Cambia lingua");
$form .= Form::select("lang", $lang_list, $current_lang, ["class" => "form-control", "id" => "select-lang"]);
// soo see check which type of lang needs to change
$form .= Form::hidden("is_admin", $is_admin);
$form .= Form::close();
return $form;
}
示例4: getLang
/**
* Obtain the current lang
*
* @return String lingua
*/
public function getLang()
{
return $this->is_admin ? L::get_admin() : L::get();
}
示例5: translateSlug
/**
* Translates slug based on the current language
* @param $slug
* @param $table
* @param bool $is_admin se vedere lingua admin o lingua client
*/
public static function translateSlug($slug, $table, $is_admin = false)
{
$lang = $is_admin ? L::get_admin() : L::get();
$slug_lingua = DB::table($table)->where(static::$slug_field, "=", $slug)->pluck('slug_lingua');
return DB::table($table)->where(static::$slug_lingua_field, "=", $slug_lingua)->where(static::$lang_field, "=", $lang)->pluck(static::$slug_field);
}