本文整理汇总了PHP中Localization::setLocale方法的典型用法代码示例。如果您正苦于以下问题:PHP Localization::setLocale方法的具体用法?PHP Localization::setLocale怎么用?PHP Localization::setLocale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Localization
的用法示例。
在下文中一共展示了Localization::setLocale方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
\Localization::setLocale('id');
if (Schema::hasTable('top_menu')) {
$top_menu = TopMenu::all()->sortBy('urutan');
view()->share('top_menu', $top_menu);
}
}
示例2: function
<?php
Route::group(array('prefix' => Localization::setLocale()), function () {
Route::resource('admin/faq/faq', '\\Lavalite\\FAQ\\Controllers\\FaqAdminController');
Route::get('/faq', 'Lavalite\\FAQ\\Controllers\\PublicController@index');
Route::get('/faq/{slug?}', 'Lavalite\\FAQ\\Controllers\\PublicController@details');
});
示例3: session_regenerate_id
$_SESSION = [];
session_regenerate_id($delete);
return session_id();
};
return new Environment\Session($_SESSION, session_id(), 'skyhook', $regenerator);
});
// Register Environment Singletons
foreach (array('Get' => &$_GET, 'Post' => &$_POST, 'Server' => &$_SERVER, 'PostFiles' => &$_FILES, 'Cookie' => &$_COOKIE) as $class => $glbl) {
$c = "Environment\\" . $class;
Container::registerSingleton($c, function () use($c, $glbl) {
return new $c($glbl);
});
}
$cookies = Container::dispense("Environment\\Cookie");
if (isset($cookies['lang']) && Localization::localePresent($cookies['lang'])) {
Localization::setLocale($cookies['lang']);
}
Container::registerSingleton('Environment\\RequestHeaders', function () {
$headers = getallheaders();
return new Environment\RequestHeaders($headers);
});
foreach (array('Delete', 'Put') as $wrapper) {
Container::registerSingleton($wrapper, function () use($wrapper) {
$server = Container::dispense(Environment\Server);
$nsed = "Environment\\" . $wrapper;
$wrapped = $nsed::buildHelper($server);
return new $nsed($wrapped);
});
}
Container::registerSingleton('DB', function () {
return new DB(new DateTimeZone(trim(file_get_contents('/etc/timezone'))));
示例4: function
Route::post('dashboard/topmenu/urut', ['as' => 'urutTopMenu', 'uses' => 'TopMenuController@urutTopMenu']);
Route::get('dashboard/topmenu/add', ['as' => 'addTopMenu', 'uses' => 'TopMenuController@addTopMenu']);
Route::post('dashboard/topmenu', ['as' => 'storeTopMenu', 'uses' => 'TopMenuController@storeTopMenu']);
Route::get('dashboard/topmenu/{id}/edit', ['as' => 'editTopMenu', 'uses' => 'TopMenuController@editTopMenu']);
Route::patch('dashboard/topmenu/{id}', ['as' => 'updateTopMenu', 'uses' => 'TopMenuController@updateTopMenu']);
Route::get('dashboard/topmenu/{id}/delete', ['as' => 'showDeleteTopMenu', 'uses' => 'TopMenuController@showDeleteTopMenu']);
Route::delete('dashboard/topmenu/{id}', ['as' => 'deleteTopMenu', 'uses' => 'TopMenuController@deleteTopMenu']);
Route::get('dashboard/slider', ['as' => 'slider', 'uses' => 'SliderController@daftarslider']);
Route::post('dashboard/slider/urut', ['as' => 'urutSlider', 'uses' => 'SliderController@urutSlider']);
Route::get('dashboard/dataTableSlider', ['as' => 'dataTableSlider', 'uses' => 'SliderController@dataTableSlider']);
Route::get('dashboard/slider/add', ['as' => 'addSlider', 'uses' => 'SliderController@addSlider']);
Route::patch('dashboard/slider/{id}/add', ['as' => 'addToSlider', 'uses' => 'SliderController@addToSlider']);
Route::get('dashboard/slider/{id}/upload', ['as' => 'addImageSlider', 'uses' => 'SliderController@addImageSlider']);
Route::get('dashboard/slider/{id}/remove', ['as' => 'showRemoveSlider', 'uses' => 'SliderController@showRemoveSlider']);
Route::patch('dashboard/slider/{id}/remove', ['as' => 'removeSlider', 'uses' => 'SliderController@removeSlider']);
});
Route::get('get/chart', ['as' => 'getChartData', 'uses' => 'HomeController@getChartData']);
Route::get('chart', 'HomeController@chart');
#Auth
Route::get('login', 'Auth\\AuthController@getLogin');
Route::post('login', ['as' => 'login', 'uses' => 'Auth\\AuthController@postLogin']);
Route::get('logout', 'Auth\\AuthController@getLogout');
Route::get('dashboard/data.user', ['as' => 'datatables.user', 'uses' => 'DashboardController@postDataUser']);
Route::get('dashboard/user', ['as' => 'daftar.user', 'uses' => 'DashboardController@daftarUser']);
#FrontEnd
Route::group(['prefix' => Localization::setLocale(), 'middleware' => ['localize']], function () {
Route::get('/', ['as' => 'homepage', 'uses' => 'HomeController@index']);
Route::get('search', ['as' => 'search', 'uses' => 'HomeController@search']);
Route::get('{slug}', ['as' => 'show.page', 'uses' => 'PageController@showPage']);
Route::get('{kategori}/{slug}', ['as' => 'show.post', 'uses' => 'PostController@showPost']);
});
示例5: function
<?php
Route::group(['prefix' => Localization::setLocale()], function () {
Route::resource('admin/contact', 'Lavalite\\Contact\\Controllers\\ContactAdminController');
Route::group(['prefix' => '/'], function () {
Route::get(Config::get('contact::uri'), 'Lavalite\\Contact\\ContactController@form');
Route::post(Config::get('contact::uri'), 'Lavalite\\Contact\\ContactController@send');
});
});