Slim does not 'flash' error data \
Posted: Tue Nov 25, 2014 12:28 am
I'm having some issues displaying the flash variable via Slim and Twig. When I POST to slim it renders the page without the 'error'. Thoughts?
$app->get('/getintouch', function() use ($app, $settings) {
$app->render('getintouch.html');
});
$app->post('/getintouch', function() use ($app, $settings) {
$name = $app->request->post('name');
if (strlen($name) < 2) {
$app->flash('error', 1);
$app->redirect('/getintouch');
}
});
$app->get('/getintouch', function() use ($app, $settings) {
$app->render('getintouch.html');
});
$app->post('/getintouch', function() use ($app, $settings) {
$name = $app->request->post('name');
if (strlen($name) < 2) {
$app->flash('error', 1);
$app->redirect('/getintouch');
}
});