coduo / TuTu

Flexible HTTP server mocking tool in PHP. TuTu can work with built-in php server so everything that you need to use is php.
MIT License
58 stars 10 forks source link

Are Twig functions supported? #31

Closed alexislefebvre closed 7 years ago

alexislefebvre commented 7 years ago

I use a simple configuration with Tutu:

foo_bar:
  request:
    path: /api/foo/{id}
    methods: ['GET']
  response:
    content: '@resources/api/…/bar.json.twig'
    headers:
      "Content-type": "application/json"

But When I use some Twig function it doesn't work.

Example:

{% extends 'base.json.twig' %}

The base.json.twig file exists, but TuTu only returns base.json.twig instead of an error or the content of the base.json.twig.

In the README of this project it's written In content template you have access to all twig features., so am I missing something?

norberttech commented 7 years ago

I would say that twig is not able to localize base.json.twig location

alexislefebvre commented 7 years ago

Thanks for you answer. I'm closing this I didn't have the same error again.