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


PHP Guardian::memorize方法代码示例

本文整理汇总了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);
});
开发者ID:razordaze,项目名称:mecha-cms,代码行数:30,代码来源:route.menu.php

示例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 '&#32;<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;
开发者ID:tovic,项目名称:comment-reply-plugin-for-mecha-cms,代码行数:31,代码来源:task.comment.reply.php

示例3: error

 public static function error($text = "", $icon = null, $tag = 'p')
 {
     self::add('error', $text, $icon, $tag);
     Guardian::memorize();
     self::$errors++;
 }
开发者ID:razordaze,项目名称:mecha-cms,代码行数:6,代码来源:notify.php

示例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;
 }
开发者ID:razordaze,项目名称:mecha-cms,代码行数:22,代码来源:guardian.php

示例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++;
});
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:27,代码来源:notify.php


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