News for hackers. Stuff that matters.
Re:Comparison with Other Frameworks by raboukhalil on Saturday October 22, 2016 @11:21AM (#12769020)
PHP also offers a nice way to write templates without even having to use echo and without braces:

  <?php foreach($x as $y): ?>
  <h1><?= $y->title ?></h1>
  <?php endforeach; ?>
Re:Comparison with Other Frameworks by combatentropy on Saturday October 22, 2016 @01:45PM (#12769675)
Yes, that's what I do. I also think it's fine to use omit trailing semicolons and to use short-open tags (I already labelled the file .php --- why do I have to keep saying "php" all over it? And I'm not usually outputting XML.)

  <? foreach($x as $y): ?>
      <h1><?= h($y->title) ?></h1>
  <? endforeach ?>
You just want to make sure to escape all output with htmlspecialchars, or define a shorter function like I did ("h").
Re:Comparison with Other Frameworks by raboukhalil on Saturday October 22, 2016 @04:48PM (#12770495)
I agree!
Re:Comparison with Other Frameworks by bluejekyll on Saturday October 22, 2016 @11:31AM (#12769066)
PHP can only be used serverside, no? Can't write single page apps.
Re:Comparison with Other Frameworks by goatlover on Saturday October 22, 2016 @05:50PM (#12770716)
You can't do SPAs with ajax calls?
Re:Comparison with Other Frameworks by bluejekyll on Saturday October 22, 2016 @10:47PM (#12771623)
Huh? I'm asking how with PHP. You would write a 100% client side app.
Re:Comparison with Other Frameworks by g00gler on Sunday October 23, 2016 @03:12PM (#12774927)
You can't use JSP to make a SPA, either. I was replying to the statement "Angular is for n00bz"