Someone can help me with that… How to pass a variable ($membreConf
) in that:
$membreConf = '/home/mapubs/conf_maplate.php'; $route = new Route(); $route->add('/', function(){ include($membreConf); include('home.php'); });
Presently, is not working 🙁
Advertisement
Answer
In this case, the use
statement is missing.
See example #3 of https://www.php.net/manual/en/functions.anonymous.php
$membreConf = '/home/mapubs/conf_maplate.php'; $route = new Route(); $route->add('/', function() use ($membreConf) { include($membreConf); include('home.php'); });