Jump to content

[solved] Pass variable from module to Controller


jd440

Recommended Posts

Hi everyone.

 

I'm looking a way to pass a variable from module to controler.

 

I got in my module

public function hookactionValidateOrder($params)
{
    $message_denvoie = array("a" => "orange", "b" => "banana", "c" => "apple");
    echo "<hr>print_r module";
    print_r($message_denvoie);
    return $message_denvoie;
}

I have in the class

// Hook validate order
$yo = Hook::exec('actionValidateOrder', array(
    'cart' => $this->context->cart,
    'order' => $order,
    'customer' => $this->context->customer,
    'currency' => $this->context->currency,
    'orderStatus' => $order_status
));
echo "<hr>print_r hors-module ==>";
print_r($yo);

But The result is:

Quote


 

print_r moduleArray ( [a] => orange => banana [c] => apple )

print_r hors-module ==>Array

 

Why the second one doesn't print the array but only the word "Array"

How Could I get it?

 

Edited by jd440 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...