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


PHP Localization::setLocale方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:alkzzz,项目名称:mycms,代码行数:13,代码来源:AppServiceProvider.php

示例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');
});
开发者ID:lavalite,项目名称:faq,代码行数:7,代码来源:routes.php

示例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'))));
开发者ID:oktoshi,项目名称:skyhook,代码行数:31,代码来源:index.php

示例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']);
});
开发者ID:alkzzz,项目名称:mycms,代码行数:31,代码来源:routes.php

示例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');
    });
});
开发者ID:lavalite,项目名称:contact,代码行数:9,代码来源:routes.php


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