User Tools

Site Tools


Basic Website with Tina4

Tina4 already has Twig template engine built in so creating a website is one of the easiest things you can do. Start off by creating an index.twig file in the src/templates folder. If you hit up the default URL http://localhost:7145 then you will see a blank page.

You can then flesh out your index.twig file with valid HTML. The beauty of Twig is you can include other files, for example a header or footer. The example below illustrates this.

<!DOCTYPE html>
  {%include "snippets/header.twig"%}
  <h1>This is a Heading</h1>
  <p>This is a paragraph.</p>
  {%include "snippets/footer.twig"%}
<title>Page Title</title>
  <a href="">Tina4</a>
basic-website.txt · Last modified: 2021/06/15 15:05 by andre