Of all the languages, I’ve never understood why people “extend” PHP. It’s already got everything baked in. If you need a bloated framework on top of PHP, then PHP isn’t the answer you were looking for.
Twig is easier for security, everything is sanitised by default. Also helps to separate your view layer from your logic.
Think about how Wordpress goes about it, mixed logic and views and needing to wrap everything in an esc html, esc attr or whatever else other functions they have available because they decided to go the native php route.
Twig has a valid role to play in php web dev I reckon.
3 Comments
meowmeow@quokk.au · -1 pts · 113d
Of all the languages, I’ve never understood why people “extend” PHP. It’s already got everything baked in. If you need a bloated framework on top of PHP, then PHP isn’t the answer you were looking for.
Johnnyvibrant@discuss.tchncs.de · 2 pts · 113d
Twig is easier for security, everything is sanitised by default. Also helps to separate your view layer from your logic.
Think about how Wordpress goes about it, mixed logic and views and needing to wrap everything in an esc html, esc attr or whatever else other functions they have available because they decided to go the native php route.
Twig has a valid role to play in php web dev I reckon.
meowmeow@quokk.au · -1 pts · 113d
That was over a decade ago. Use modern PHP. Wordpress always did it WRONG anyway.