Using Twig on Hiawatha

28 August 2018, 09:58
Is there a way to use Twig framework on Hiawatha?
If not do you have some alternative suggestions for Twig?
Hugo Leisink
28 August 2018, 10:44
Sure, why not? Have you given it a try yet?
28 August 2018, 12:10
Hi Hugo.
Yes, I tried, but when i try to open my project (very simple Hello world project), the browser tell me that i'm trying to open a bin file and a download dialog is opened.
I tried the same project with Apache and its opened it.

I used this simple hello world example:

my controller is called "index.php" (located at /var/www/hello_world/web), the template is called "index.html", (located at /var/www/hello_world/templates).

I config the hiawath.conf as follow:
WebsiteRoot = /var/www/hello_world/web
StartFile = index.php

If i change the WebsiteRoot to point to /var/www/hello_world/templates, and i change the StartFile to be my template file, its opened the template file just fine, but again its a static html page.

I probably missing something.
28 August 2018, 16:25
I have done some simple check. the problem is not related to the Twig framework, its more basic. I try to open simple php file and got the same result, download dialog for a bin file. I probably doing something wrong...
28 August 2018, 16:37
Ok, found the problem...

Look like its working.
Hugo Leisink
28 August 2018, 19:30
Well done.
This topic has been closed.