# Dancer with Templates
{id: dancer-templates}


## Template Tiny
{id: template-tiny}

```
.
├── app.psgi
└── views
    └── main.tt
```

* The default templating engine is the Tiny engine [Dancer2::Template::Tiny](https://metacpan.org/pod/Dancer2::Template::Tiny)
* [Template::Tiny](https://metacpan.org/pod/Template::Tiny)

![](examples/dancer/template-tiny/app.psgi)

## Template Tiny - the template
{id: template-tiny-the-template}


![](examples/dancer/template-tiny/views/main.tt)

## Template Toolkit
{id: template-toolkit}

* [Dancer2::Template::TemplateToolkit](https://metacpan.org/pod/Dancer2::Template::TemplateToolkit)
* [Template::Toolkit on MetaCPAN](https://metacpan.org/pod/Template)
* [Template::Toolkit](http://www.template-toolkit.org/)

![](examples/dancer/template-toolkit/config.yml)

![](examples/dancer/template-toolkit/app.psgi)

![](examples/dancer/template-toolkit/views/main.tt)

## Template Toolkit change tags
{id: template-toolkit-change-tags}

![](examples/dancer/template-toolkit-tags/config.yml)

![](examples/dancer/template-toolkit-tags/app.psgi)

![](examples/dancer/template-toolkit-tags/views/main.tt)



## Template Toolkit include
{id: template-toolkit-include}
{i: INCLUDE}

![](examples/dancer/template-include/config.yml)

![](examples/dancer/template-include/app.psgi)
![](examples/dancer/template-include/views/main.tt)
![](examples/dancer/template-include/views/incl/header.tt)
![](examples/dancer/template-include/views/incl/footer.tt)

* Also include navigation etc.

## Template Toolkit layout
{id: template-toolkit-layout}

![](examples/dancer/template-layout/config.yml)

![](examples/dancer/template-layout/app.psgi)
![](examples/dancer/template-layout/views/main.tt)
![](examples/dancer/template-layout/views/layouts/general.tt)

## Showing the current time using templates
{id: showing-the-current-time-using-templates}

![](examples/dancer/show_time_using_template/app.psgi)
![](examples/dancer/show_time_using_template/views/page.tt)
![](examples/dancer/show_time_using_template/test.t)

## Showing an array
{id: showing-an-array}

![](examples/dancer/show_array/app.psgi)
![](examples/dancer/show_array/views/page.tt)
![](examples/dancer/show_array/test.t)

## Showing Hash of Hashes
{id: showing-hash-of-hashes}

![](examples/dancer/show_hoh/app.psgi)
![](examples/dancer/show_hoh/views/page.tt)
![](examples/dancer/show_hoh/planets.csv)
![](examples/dancer/show_hoh/test.t)

