本文整理汇总了PHP中Guardian::memorize方法的典型用法代码示例。如果您正苦于以下问题:PHP Guardian::memorize方法的具体用法?PHP Guardian::memorize怎么用?PHP Guardian::memorize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Guardian
的用法示例。
在下文中一共展示了Guardian::memorize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
<?php
/**
* Menu Manager
* ------------
*/
Route::accept($config->manager->slug . '/menu', function () use($config, $speak) {
if (Guardian::get('status') !== 'pilot') {
Shield::abort();
}
$menus = Get::state_menu();
Config::set(array('page_title' => $speak->menus . $config->title_separator . $config->manager->title, 'cargo' => DECK . DS . 'workers' . DS . 'cargo.menu.php'));
$G = array('data' => array('content' => $menus));
if ($request = Request::post()) {
Guardian::checkToken($request['token']);
// Check for invalid input
if (preg_match('#(^|\\n)(\\t| {1,3})(?:[^ ])#', $request['content'])) {
Notify::error($speak->notify_invalid_indent_character);
Guardian::memorize($request);
}
$P = array('data' => $request);
if (!Notify::errors()) {
File::write($request['content'])->saveTo(STATE . DS . 'menu.txt', 0600);
Notify::success(Config::speak('notify_success_updated', $speak->menu));
Weapon::fire('on_menu_update', array($G, $P));
Guardian::kick($config->url_current);
}
}
Shield::lot(array('segment' => 'menu', 'the_content' => $menus))->attach('manager', false);
});
示例2: do_response_reply_x
{
echo Asset::javascript(File::D(__DIR__) . DS . 'assets' . DS . 'sword' . DS . 'do.js');
}
function do_response_reply_x($post)
{
global $config, $speak, $parent;
$s = Asset::loaded($config->protocol . ICON_LIBRARY_PATH) ? '<i class="fa fa-times-circle"></i> ' : "";
echo ' <a href="' . $post->url . '" class="btn btn-reject btn-reject-reply"' . ($parent === false ? ' style="display:none;"' : "") . '>' . $s . $speak->cancel . '</a>';
}
Weapon::add('comment_footer', 'do_response_reply', 20.1);
Weapon::add('comment_form_button_after', 'do_response_reply_x');
Weapon::add('shell_before', 'do_response_reply_css');
Weapon::add('SHIPMENT_REGION_BOTTOM', 'do_response_reply_js');
// No JavaScript
if ($parent !== false) {
Guardian::memorize('parent', $parent);
if ($response = Get::commentAnchor($parent)) {
Weapon::add('chunk_before', function ($G) use($speak, $parent, $response) {
if (File::N($G['data']['path']) === 'comment.form') {
$prefix = File::B(File::D($response->path));
$to = Config::speak($prefix . '_reply_to_', Cell::a('#' . $prefix . '-' . $parent, $response->name));
echo Cell::h4($to);
}
});
}
}
// Error
if ($s = Request::post('parent', false)) {
Filter::add('guardian:kick', function ($url) use($config, $s) {
if (!Notify::errors()) {
return $url;
示例3: error
public static function error($text = "", $icon = null, $tag = 'p')
{
self::add('error', $text, $icon, $tag);
Guardian::memorize();
self::$errors++;
}
示例4: kick
/**
* ============================================================
* URL REDIRECTION
* ============================================================
*
* -- CODE: ---------------------------------------------------
*
* Guardian::kick('manager/login');
*
* ------------------------------------------------------------
*
*/
public static function kick($path = "")
{
$path = Converter::url(File::url($path));
$path = Filter::apply('guardian:kick', $path);
$G = array('data' => array('url' => $path));
Guardian::memorize(array('url_origin' => Config::get('url_current')));
Weapon::fire('before_kick', array($G, $G));
header('Location: ' . $path);
exit;
}
示例5: function
<?php
// default
Notify::plug('bare', function ($text, $icon = 'bell', $kind = 'default') {
Notify::add($kind, ($icon ? '<i class="fa fa-fw fa-' . $icon . '"></i> ' : "") . $text);
});
// success
Notify::plug('success', function ($text, $icon = 'check') {
Notify::bare($text, $icon, 'success');
Guardian::forget();
});
// info
Notify::plug('info', function ($text, $icon = 'info-circle') {
Notify::bare($text, $icon, 'info');
});
// warning
Notify::plug('warning', function ($text, $icon = 'exclamation-triangle') {
Notify::bare($text, $icon, 'warning');
Guardian::memorize();
Notify::$errors++;
});
// error
Notify::plug('error', function ($text, $icon = 'times') {
Notify::bare($text, $icon, 'error');
Guardian::memorize();
Notify::$errors++;
});