Hacker News new | ask | show | jobs
by zelphirkalt 872 days ago
Using a traditional templating engine is not treating HTML more as a string than React based frameworks do. Maybe even lass so, because of the separation of concerns. Traditional tenplating engines can separate part of HTML into named components without problem. Check for example Jinja2 or its clones in other languages. There is really no need to treat HTML in a plain PHP string concattenation style. There has not been for decades.

If you want something more structured data, look at sxml (see Racket or Guile). Then implement that in a library and use it in place of the default of most (all?) SPA frameworks.