06-14-2016, 01:37 PM (This post was last modified: 06-14-2016, 01:38 PM by PaulD. Edit Reason: added quote )
Quote:I am not a designer, but I got to hate writing PHP-views. :-) Although PHP is thought as a template language, as such it is a failure, I think.
Here is what I can say:
1. A specialized template language is needed, nevertheless how designers feel comfortable with PHP. Even, it could be partially portable outside PHP-systems.
3. A sophisticated template engine adds more value to programming than just arrangement relationships between programmers and designers. Seek for block-support, blocks could be defined in an abstract way and placed and moved wherever you like in your master template, a concrete controller can fill them with the concrete information.
A good template engine will allow you to clear your controllers from any visual design aspects - this is not achieved by me yet, due to maintaining BC, but it is achievable.
4. The CI3 built-in parser is quite minimalistic, it does not add significant value in comparison with the pure PHP-views. Better don't waste your time with it. Carefully pick up a third-party template engine and integrate it within your application.
In comment to your points:
However php started, it is so much more than a template language now. That is like saying windows is just a way to access my files.
1. It might be needed, it might not. Some projects will benefit, others won't.
2. It may have changed. But I now see why data should be escaped on output. It makes alot of sense to me now.
3. Pure php gives the full power of php to views. A template engine will always have limited application of these things. However a template engine can offer block support, theming etc. but they all offer different benefits. Pre-defining a template engine in the framework would be wrong. Controllers are always free of design considerations, well at least mine are.
4. You are right. The built in template parser is not something I have actually ever used because of this. I think it should be deprecated in CI4.
Templating systems are so diverse and numerous, to be forced to use one like laravel does with twig, is in my opinion, verging on ridiculous. My framework of choice should not be telling me what templating system, shopping cart, file upload, forum, blog, authorisation method, database or image gallery I should use. That is up to me, surely, and my choice will not be the same as your choice for any of them.
CI does not do any of this to me, which I why I love using it.