當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。