當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BaseController::cookieGet方法代碼示例

本文整理匯總了PHP中BaseController::cookieGet方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseController::cookieGet方法的具體用法?PHP BaseController::cookieGet怎麽用?PHP BaseController::cookieGet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BaseController的用法示例。


在下文中一共展示了BaseController::cookieGet方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: hiddenbooru

 private static function hiddenbooru($message)
 {
     if (BaseController::whichDarknet() == 'i2p') {
         $domain = "hiddenbooru.i2p";
     } else {
         $domain = "hbooruahi4zr2h73.onion";
     }
     if (BaseController::cookieGet('hb') != "on") {
         $replace = '<a href="http://' . $domain . '/post/view/$1" class="link-hb" target="_blank">' . '[HiddenBooru:$1]</a>';
     } else {
         $replace = '<a href="http://' . $domain . '/post/view/$1" target="_blank">' . '<img src="http://' . $domain . '/post/preview/$1"></a>';
     }
     return preg_replace("/\\[HiddenBooru:([0-9]+)\\]/", $replace, $message, 1);
 }
開發者ID:libre-net-society,項目名稱:onelon,代碼行數:14,代碼來源:OnelonMarkup.php

示例2: session_start

/*
|--------------------------------------------------------------------------
| Application & Route Filters
|--------------------------------------------------------------------------
|
| Below you will find the "before" and "after" events for the application
| which may be used to do any work before or after a request into your
| application. Here you may also register your custom route filters.
|
*/
App::before(function () {
    if (!Request::is('api/*')) {
        session_start();
        if (in_array(BaseController::cookieGet('lang'), ['en', 'ru', 'by'])) {
            App::setLocale(BaseController::cookieGet('lang'));
        }
        if (!BaseController::sessionGet('token')) {
            BaseController::sessionSet('token', BaseController::randString(6));
        }
    }
});
App::after(function () {
});
/*
 *  Registration captcha check
 */
Route::filter('signup', function () {
    if (!BaseController::checkCaptcha()) {
        return View::make('verif.signup');
    }
開發者ID:libre-net-society,項目名稱:onelon,代碼行數:30,代碼來源:filters.php

示例3:

<!DOCTYPE html>

<html>
    <head>
        <meta charset="utf-8">
        <title>onelon: {{{Lang::get('general.site_title')}}}</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel='alternate' type='application/rss+xml' title='RSS' href='/rss'>

<?php 
if (in_array(BaseController::cookieGet('style'), ['cyborg', 'darkly', 'slate', 'superhero'])) {
    $style = BaseController::cookieGet('style');
} else {
    $style = 'darkly';
}
?>
        <link rel="stylesheet" type="text/css" href="/css/{{{$style}}}.css">
        <link rel="stylesheet" type="text/css" href="/css/main.css">
        <link rel="icon" type="image/png" href="/favicon.png" />
    </head>
    <body>
    
        <div class="container">
        @include('navigation')
        </div>

        <div class="container">
        @include('adverts')
        </div>
                
開發者ID:libre-net-society,項目名稱:onelon,代碼行數:30,代碼來源:master.blade.php


注:本文中的BaseController::cookieGet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。