Mustache. How do I implement it?

Hi there.
I am reading through Slim 4 - ebook 1 and am given this.
I am trying to implement the Mustach templating engine.
Per the instructions I am told this: templates/home.mustache

How do I implement it?

I.e. here it is in a little more detail:

Usage

Now we want to render the first mustache template within an action handler.

Create a mustache template file: templates/home.mustache <<<??? not sure what this means. I have the templates directory but fail to understand what home.mustache is?

Hi @MarkJC

templates/home.mustache

In this example templates is a directory (folder) with the name “templates”. First create this directory in your project root.

home.mustache is a template file within that templates directory. home is the filename and mustache is the file extension. “mustache” is the typical file extension for mustache templates.

1 Like