Reputation: 4908
I want to set a variable in index.php and want to access that variable in any controller of open cart.
Upvotes: 1
Views: 1898
Reputation: 4908
i got it we can achieve this by declaring a public variable in controller.php in system/engine/controller.php and then u can access this variable in any controller by simply doing
$this->variable_name = 'foo';
Upvotes: 0
Reputation: 30187
I think what you are looking for is a session variable.
$_SESSION['your Variable'] = "variable value";
this way you can set it.
You can get it by accessing.
$var_value = $_SESSION['your Variable']
Upvotes: 1