本文整理汇总了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);
}
示例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');
}
示例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>