3
Phlisg
7y

I think I'm just starting to lose my patience...

For some fucking reason, the fucking "POST" gets outputted on the GET request, and the GET "elseif" doesn't show up.

W.
T.
FFFFFFFFFFFFFFFFFFFFFFFFFFFF!!!

Comments
  • 0
    FYI, This is what I get...
  • 2
    maybe this helps debugging it
    https://www.getpostman.com/
  • 1
    @heyheni I'll give it a look, thanks for the link :)

    The main problem is:
    If I do "if method = post; send json; else send html because it's a GET request", and invoking the "extends" inside the GET conditional, I will auto-magically get the fucking GET response while doing a POST request

    Gah!

    I hate this <closedSource> CMS
  • 0
    but its not php (by it self) that does that but whatever is in that app twig thingy... could you just use twig dump to see what is actually going on in that app.request?
  • 0
    @commanderkeen

    I can:
    For the GET request I get app.request.server.parameters.REQUEST_METHOD = GET

    which is correct

    For the POST request, I get POST, also correct.

    everything is correct from what I see (the dump is like nearly 1000 lines... dunno if I should look for something else). GET Query strings get parsed as GET, Post query strings get parsed as POST, all good

    I don't know what they did to twig :[
  • 0
    app.request.request.get('start')

    don't know what that is or does, but it looks weird. You might want to take this to stack-o or just go outside and take a walk or what ever helps you solve weird shit ;)
  • 0
    @commanderkeen Just had lunch! Still not calm

    That is to get a POST data variable sent via ajax, and if it is set, means we are in POST query-type :D

    To get GET queries you use app.request.query.get(), for POST queries app.request.request.get(), very ugly I concede
  • 1
    You cannot conditionally define a block in twig. If you extend a template everything needs to be inside blocks. Everything outside blocks is ignored. Took me a few minutes too to realise.

    https://github.com/twigphp/Twig/...
  • 1
    @joas Yes! Finally found this out too this instant :(

    Oh well... Let's have ugly templates
  • 1
    @Phlisg 3 hours well spent 😋

    I'm just studying at the time. So much freetime. Maybe too much. I better get back to work otherwise I become too lazy.
  • 0
    @joas since we're using a very custom CMS (with no access to php files), I often question whether their implementation is done correctly or if I did something wrong with twig :D

    Lucky you with you free time :(
Add Comment