How to to install mustache.php library

Published 1 month ago by mstdmstd

Hello,

In my laravel 5.6 application I need to install mustache.php library I googled and find this link: https://github.com/bobthecow/mustache.php/wiki

I added a line inyo my composer.json :

  "mustache/mustache": "~2.5"

But have I to add this provider into config/app.php ? If yes, which syntax? How correctly to attach mustache.php to my app ?

Thanks!

Cronix
Cronix
1 month ago (647,500 XP)

No, it's not a laravel package so there isn't a laravel service provider for it. You'd just use it like normal (like the docs show).

Not sure how it will conflict with laravel's blade template engine though, since it uses the same syntax. I think you'll run into problems using this. It will probably be fine if you don't use it in a .blade.php view, but then you can't use blade either.

mstdmstd
like the docs show

could you please give a link ?

Cronix
Cronix
1 month ago (647,500 XP)

You already posted it. It's just the readme in the repo.

https://github.com/bobthecow/mustache.php

Cronix
Cronix
1 month ago (647,500 XP)

Composers autoloader will take care of autoloading the classes, so you don't need to worry about that part (as the docs say). You just need to import and use the mustache library classes, like normal php.

Please sign in or create an account to participate in this conversation.