本文整理匯總了PHP中MY_Lang::setLang方法的典型用法代碼示例。如果您正苦於以下問題:PHP MY_Lang::setLang方法的具體用法?PHP MY_Lang::setLang怎麽用?PHP MY_Lang::setLang使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MY_Lang
的用法示例。
在下文中一共展示了MY_Lang::setLang方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: edit_tariff_menus
public function edit_tariff_menus()
{
\MY_Lang::setLang('en_US');
$lang = new \MY_Lang();
$lang->load('admin_menu');
$type = $_GET['type'] ? $_GET['type'] : 'billing';
$tariffs = \saas\models\SaasTariff::all();
foreach ($tariffs as $key => $tariff) {
$tariffs[$key]->menu = $this->load->module('admin_menu')->setDevMode("Tariff_{$tariff->id}_menu", $type)->show();
}
$menus = array('full' => $this->load->module('admin_menu')->setDevMode('full')->show(), 'tariffs' => $tariffs);
$menus = array_filter($menus);
$this->template->registerCssFile('./application/modules/admin_menu/assets/js/context_menu/jquery.contextMenu.css');
$this->template->registerJsFile('./application/modules/admin_menu/assets/js/context_menu/jquery.contextMenu.js', 'after');
$this->template->registerJsFile('./application/modules/admin_menu/assets/js/context_menu/jquery.ui.position.js', 'after');
$this->load->module('admin_menu')->unsetDevMode();
\CMSFactory\assetManager::create()->setData('menus', $menus)->registerStyle('admin_menu_dev_tariff')->registerScript('admin_menu_dev')->renderAdmin('edit_tariff_menus');
}
示例2: getMenuList
/**
* Get rendered menu
* @param string $type - menu file name
* @return string
*/
public static function getMenuList($type)
{
self::$CI =& get_instance();
self::$MENU_LIST = '';
\MY_Lang::setLang('en_US');
$lang = new \MY_Lang();
$lang->load('admin_menu');
$menu = (include_once self::getMenuPath() . "{$type}.php");
\MY_Lang::setLang(self::$CI->config->item('language'));
$lang->load('admin_menu');
foreach ($menu as $item) {
self::renderMenuItem($item);
}
return self::$MENU_LIST;
}