Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Phlisg25247y@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 -
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?
-
Phlisg25247y@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 :[ -
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 ;) -
Phlisg25247y@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 -
joas19427yYou 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/... -
Phlisg25247y
-
Phlisg25247y@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 :(
Related Rants
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!!!
undefined
fuck it