Closed newtonianb closed 11 years ago
I'm trying to dynamically add assets from my BaseController given the controller / method, below is a simplified example.
$path = public_path() . "/assets/css/$controller/$method"; Basset::collection('custom', function($collection) { $collection->directory($path, function($collection) { if (file_exists($path . '/style.scss')) $collection->stylesheet('style.scss'); elseif (file_exists($path . '/style.sass')) { $collection->stylesheet('style.sass'); } }); });
However I'm getting Undefined variable: path. How do I pass in that variable to make it accesible?
Undefined variable: path
function($collection) use ($path), see the doc of PHP for more informations.
function($collection) use ($path)
thanks!
I'm trying to dynamically add assets from my BaseController given the controller / method, below is a simplified example.
However I'm getting
Undefined variable: path
. How do I pass in that variable to make it accesible?