How can i pass multiple variables to a function?
For example, i want to pass variables from my controller to my view.
i want to pass var1, var2, and var3 by calling render() and i want it to go into my $vars array. how can i do that?
here is my code:
$var1 = "hi";
$var2 = "hello";
$var3 = "lol";
$this->render();
and here is my render() function:
$vars = array();
public function render($vars) {
require dirname(__DIR__).'/views/header.php';
require dirname(__DIR__).'/views/body.php';
require dirname(__DIR__).'/views/footer.php';
}