[eluser]DocFunky![/eluser]
Hello there,
I've been trying to figure out how to use those flashdatas.
I remember having difficulties last time, and this time again, it seems that I forget something.
So basically, I'm trying to set up a flasherror somewhere :
Code:
if(!$this->paypal_pro->APICallSuccessful($PayPalResult['ACK']))
{
$this->session->set_flashdata('flashError', array('Errors'=>$PayPalResult['ERRORS']));
redirect('main/form');
}
And in my main/form I got :
Code:
function Form()
{
// Process validation form
if ($this->form_validation->run() == FALSE)
{
//IF the validation process hasn't been run or there are validation errors
$this->parser->parse('template/template', $data);
}
and in that view, I'm trying to get that flashError :
Code:
<?php if($this->session->flashdata('flashError')):?>
<div class='flashError'>
<?php
$flashError=$this->session->flashdata('flashError');
foreach( $flashError['Errors'] as $Error){
echo $Error['L_SHORTMESSAGE'].' ('.$Error['L_ERRORCODE'].'):';
echo '<br/>';
echo $Error['L_LONGMESSAGE'];
}
?>
</div>
<?php endif?>
I don't have anything in that variable, and when I try to var_dump it, It returns me false.
Can someone explain me how to use it despite the official documentation saying "will only be available for the next server request, and are then automatically cleared"
Thank you