rcrowe / TwigBridge

Give the power of Twig to Laravel
MIT License
895 stars 167 forks source link

Lumen not loading config.extensions.functions #203

Open cviebrock opened 9 years ago

cviebrock commented 9 years ago

I'm not sure if this is the same issue as #174, but I'm trying to use the route(...) function in my views in a Lumen application.

I followed the instructions from https://github.com/rcrowe/TwigBridge#installation-on-lumen and copied the configuration to config/twigbridge.php, added "route" to the functions array (after "elixir", "head" and "last").

Loading a view that contains {{ route('home') }} gives me a "whoops" screen, and some debugging reveals that the error is: "The function "route" does not exist in "layouts.html" at line 24"

Further debugging shows that this line in Extension/Loader/Functions.php returns an empty array:

$load      = $this->config->get('twigbridge.extensions.functions', []);

Stepping through the get() function, it doesn't seem to include the twigbridge configuration (either mine or the package's) at all.

Did I do something wrong?

JC5 commented 9 years ago

Same here. I cannot access the route method either. link_to_route doesn't work either. Editing either config file does not work.

noisysocks commented 9 years ago

Having the same issue.

barryvdh commented 9 years ago

Did you $app->configure('twigbridge') to load the config?

noisysocks commented 9 years ago

I did indeed. I set up a new Lumen project just now to demonstrate the problem, download it here.

sn0rcha commented 7 years ago

I have the same problem, did anyone find a solution?