For me, that's not a feature, it's an oddity that I have to work around. I guess it's a feature if you're using PHP as the HTML template language it was designed to be, but I suspect that's a minority use case these days.
For me, that's not a feature, it's an oddity that I have to work around. I guess it's a feature if you're using PHP as the HTML template language it was designed to be, but I suspect that's a minority use case these days.
Why layer an additional templating language (Smarty, etc) on top of PHP - incurring extra processing and parsing - when PHP is a perfectly capable templating language itself?
There are cases where you may need to do this (if you can't "trust" the templates for example and you need to enforce some kind of validations or restrictions on them) but otherwise you just need to follow/enforce business rules about what can go in your views, and just use plain ol' PHP..
Edit: By which I mean, Symfony improves things by working around PHP's suboptimal default.
From past experience: to stop shittier developers at your company putting controller logic in the templates. Using something that does nothing but templating ensures that your templates do nothing but present data.
I guess the difference could come from how efficient the template-to-PHP compilation is, but I bet you're right and it's trivial in most cases.
Blade (used by Laravel) seems to be more along the lines of "bare PHP/bind to PDO object" but I haven't studied it too hard because i'm such a twig fanboy.
Well, I would venture a guess that you should have looked up the language's name and its meaning, then the entire focus of PHP might not come as much of a surprise.
It takes you about 3-4 seconds to change it for your entire project.
I was referring to the fact that the first thing pretty much all PHP apps do is say "Wait! Don't output anything yet! I have code to run!". I believe modern PHP frameworks generally borrow the controller/template pattern from other languages, because it generally makes more sense than PHP's default of outputting HTML unless told otherwise.