ricardoper / slim4-twig-skeleton

A better Slim Framework 4 Skeleton with Twig that offers a sane folder structure where everything is customizable
MIT License
12 stars 2 forks source link

Plaintext and json response examples #3

Closed rickerd closed 3 years ago

rickerd commented 3 years ago

Hi, me again.

Can you provide examples on how to use the plaintext response and the json response? I want to return just a string or maybe a json response. Not always a twig file/template.

I've added the emitters but i don't see how to use it in a controller.

ricardoper commented 3 years ago

Hi @rickerd,

Have you checked the Demo Controllers?

You can see a little example that match your needs: https://github.com/ricardoper/slim4-twig-skeleton/blob/master/app/Controllers/Demo/HomeController.php#L99

Have a look and tell me if you need more help.

Thanks, Ricardo Pereira.

rickerd commented 3 years ago

Yes I see them. Thanks!!