Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fuelphp ver 1.7.3 Function name must be a string
  • Hi ! 

    I have no problem with Fuelphp ver 1.7.2 But I get this error on 1.7.3. (Function name must be a string)
    I'm trying to pass a function to a view.

    Below is my code.

    $sayhello = function() {
    echo 'Hello World !';
    };


    $view = View::forge('welcome/index');
    $view->sayhello = $sayhello;
    echo $view;


    --------------------------
    On my view file:

    <?php $sayhello(); ?>

    Can anyone able to help me ?

    Thanks

Howdy, Stranger!

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

In this Discussion