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


PHP Slim::flashNow方法代码示例

本文整理汇总了PHP中Slim\Slim::flashNow方法的典型用法代码示例。如果您正苦于以下问题:PHP Slim::flashNow方法的具体用法?PHP Slim::flashNow怎么用?PHP Slim::flashNow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Slim\Slim的用法示例。


在下文中一共展示了Slim::flashNow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: function

        $app->flash('addPhotoError', "Error trying to add a photo. Try again?");
        $app->log->error(sprintf('Error adding a photo with data: %s: %s', $data, $e->getMessage()));
    }
    $app->redirect('/admin');
});
$app->post('/admin/delete-photo', function () use($app, $container) {
    $day = $app->request()->post('day');
    $container['imageService']->delete($day);
    $container['cache']->flush();
    $app->redirect('/admin');
});
$app->map('/login', function () use($app, $container) {
    $email = null;
    if ($app->request()->isPost()) {
        $email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL);
        $result = $container['userService']->authenticate($email, $_POST['password']);
        if ($result->isValid()) {
            $app->redirect('/admin');
        } else {
            $messages = $result->getMessages();
            $app->flashNow('error', $messages[0]);
        }
    }
    $app->render('login.html', array('email' => $email));
})->via('GET', 'POST');
$app->get('/logout', function () use($app, $container) {
    $container['userService']->clearIdentity();
    $app->redirect('/');
});
// Run app
$app->run();
开发者ID:neophyt3,项目名称:flaming-archer,代码行数:31,代码来源:index.php

示例2: array

    }
    $dataArray = array('time' => time(), 'message' => "Run finish");
    header("Content-Type: application/json");
    echo json_encode($dataArray);
    exit;
});
// add new repeater to list
$app->post('/add', function () use($app) {
    $app->log->info("Echolink CRON System - '/add' route");
    $req = $app->request();
    if (masterPassword == $req->post('masterpassword')) {
        $echolinksys = new System("mysql:host=" . host . ";dbname=" . database, username, password);
        $status = $echolinksys->addRepeater($req->post('callname'), $req->post('email'));
        if ($status == true) {
            $app->log->info("Echolink CRON System - add new Repeater to DB");
            $app->flashNow('info', 'Add repeater!');
        } else {
            $app->log->info("Echolink CRON System - is exist Repeater to DB");
            $app->flashNow('info', 'Fail adding repeater!');
        }
    }
    $url = $app->urlFor('list', array());
    $app->redirect($url);
})->name('add');
// delete repeater
$app->post('/delete', function () use($app) {
    $app->log->info("Echolink CRON System - '/delete' route");
    $req = $app->request();
    if (masterPassword == $req->post('masterpassword')) {
        $echolinksys = new System("mysql:host=" . host . ";dbname=" . database, username, password);
        $status = $echolinksys->removeRepeater($req->post('callname'));
开发者ID:ok2uec,项目名称:echolink-cron-system,代码行数:31,代码来源:index.php

示例3: flashNow

 public function flashNow($key, $value)
 {
     parent::flashNow($key, $value);
     return $this;
 }
开发者ID:suryakencana,项目名称:tekkadan,代码行数:5,代码来源:Zi.php


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