No feedback message with redirect?
Hi!
Im trying to send feedback togheter with a feedback message, like this:
if($theaters->length == 1){
foreach($theaters as $value){
$theatername = $value->nodeValue;
}
Session::add('feedback_positive', 'Just one');
Redirect::to('index/timeofday/');
return false;
}
But I'm being redirected without a feedback message.
Is this not the way to use feedback messages?
Check for this line in your application/view/your_dir/your_file.php
<?php $this->renderFeedbackMessages(); ?>
This must be included somewhere between HTML code Example view file: Click me
Yes i have that line, but still, no message =)
EDIT: Some extra information, its in a model.
Hi, you can find the definition of this method here: https://github.com/panique/huge/blob/master/application/core/View.php#L87
Maybe you're missing something or have deleted the _templates/feedback.php or so.
Try to logout then login again but type wrong password. See whether feedback working or not at all.
Yes feedback messages are working otherwise, just don't in this case =)
This is my flow, it seems as the feedback message is viewed and unset before it is display on "correct" view.
IndexController/firstpage
public function firstpage($city)
{
$this->View->render('index/firstpage', array('dates' => IndexModel::city($city));
}
User clicks a link on first page that refers to IndexController/secondpage
public function secondpage($city, $location)
{
$this->View->render('index/secondpage', array('dates' => IndexModel::city_and_location($city, $location));
}
And in IndexModel/city_and_location
if($location == 'home'){
Session::add('feedback_negative', '(No second page, straight to third page)');
Redirect::to('index/thirdpage' . $location);
return false;
}
And thirtpage
public function thirdpage($city, $location)
{
$this->View->render('index/secondpage', array('dates' => IndexModel::your_home($city, $location));
}
So flow is that the second page can be omitted, if $location true. But if I force and error into IndexController/secondpage $location, second page will display the message (with errors).
Hope this gives some clarity to the issue, and if someone can try to reproduce and see what the results are =)
(I have excluded some unnecessary code, so maybe a parentheses are wrong, but my code is otherwise legit)