Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
web page refresh
  • Hello

    I am having a problem with the following
    In my controler I am having $this->template->content = View::forge('profile/index', $data);
    where $data is a table of strings like :
    $data['welcome_Text'] = 'hello';
    $data['lbl_pseudo'] = 'John Doe';

    in my template I have <?php echo $content ; ?>

    And this is working well and displays my page. The problem is when I just refresh that page with the refresh button of my browser, then I get an "array to string" error on $content.

    I don't understand what happens during the refresh... any idea ?

    Also in the future I am looking to pass an array of tables instead of $data, is it possible ?
    (something like View::forge('profile/index', array('data' => $data, 'data2' => $data2));

    Thanks for your help :)


  • HarroHarro
    Accepted Answer
    If you want to pass data to the View on a forge, you pass an array. What is in that array, is entirely up to you.

    A reload is nothing more then re-issuing the request (either a GET or a POST). Your application is not aware it is a reload, there is no way for your client to let the application know.

    So it must be something in your code that triggers this. Is there something that may cause a different path through the code is taken on a second request? For example the existence of session data?
  • Thank you for your comment, I will check this and try to figure out where is the problem in my code !


  • found ! I was using a session variable called 'currentLang' and this was conflicting because it is probably a reserved variable or something like this. So my session was losing information and that was the source of my problem.

    Thanks Harro, your comment helped me to understand this !
  • I wouldn't know where there could be a conflict.

    In the core, in both Session and View, data is stored in data containers, shielded from the outside, and in the case of the View class, only extracted in the context of a closure.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion