本文整理匯總了PHP中BaseController::set_flash方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseController::set_flash方法的具體用法?PHP BaseController::set_flash怎麽用?PHP BaseController::set_flash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BaseController
的用法示例。
在下文中一共展示了BaseController::set_flash方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: logout
public static function logout()
{
$_SESSION['user'] = null;
session_destroy();
$content["success"] = "Logged out";
BaseController::set_flash($content);
Redirect::to("/");
}
示例2: make
public static function make($file, $content = array())
{
$twig = self::get_twig();
if (BaseController::get_flash() != null) {
$content['flash'] = BaseController::get_flash();
BaseController::set_flash(null);
}
$content['user_logged_in'] = BaseController::get_user_logged_in();
echo $twig->render($file, $content);
}
示例3: function
View::make("image.html", $content);
});
$routes->get('/uploadImage', function () {
View::make('uploadImage.html');
});
$routes->post('/comment', function () {
$params = $_POST;
$content = CommentController::add($params);
BaseController::set_flash($content);
var_dump($params);
Redirect::to("/image-" . $params["image"]);
});
$routes->post('/uploadImage', function () use($routes) {
$params = $_POST;
$fileparams = $_FILES;
$content = ImageController::uploadImage($params, $fileparams);
BaseController::set_flash($content);
if (!array_key_exists("errors", $content)) {
Redirect::to("/");
} else {
Redirect::to("/uploadImage");
}
});
$routes->post('/deleteImage', function () {
$params = $_POST;
$array = array();
$array[] = $params["imageId"];
$content = ImageController::deleteImages($array);
BaseController::set_flash($content);
Redirect::to("/");
});