5 ms·
I have used PHP for years. I like it too. Its tight integration with http is nice. The PHP language can be used as a templating language itself: <?php $u
by thirdplace_ 5y ago
I have used PHP for years. I like it too. Its tight integration with http is nice.
The PHP language can be used as a templating language itself:
<?php
$user = 'root';
?>
<p>
Hello <?= $user ?>
</p>
- philliphaydon 5y agoI think* with ASP.NET Razor Pages. You can do the same thing as: @page @{ var user = "root"; } <p> Hello @user </p>
- oaiey 5y agoRazor is awesome... It has this productivity of PHP while being consistent and have the benefit of being conceived later. Only thing which hurts there: not everywhere deployed like PHP is :) And technically you need a 2 files boilerplate. But that will vanish within the next year when I understand the .NET team right.
- jeltz 5y agoPlease, do not do that. Use an actual templating language which automatically escapes output.
- dagw 5y agoDoes PHP still look like that in 'real life'? I was reintroduced to PHP last year via a Laravel based project and it looked nothing like that. It was all Objects and Models and Controllers spread out across a half dozen folders and scaffolding code generated via CLI commands. All actual HTML was generated with Blade templates.