jitterted,
@jitterted@sfba.social avatar

Using in my apps has let me turn the "no logic in HTML templates" all the way up to 11.

I am now very aware (and suspicious) of any logic being evaluated, or even things like string concatenation, being done in HTML templates.

I may have to write a tool to warn me (or fail a test!) if I start using th:if, th:unless, or anything that looks like a method call in my Thymeleaf templates.

itsjoshbruce, (edited )
@itsjoshbruce@phpc.social avatar

@jitterted: One of the things I love about the HTML builder I wrote is you literally can’t. It’s so lovely.

jitterted,
@jitterted@sfba.social avatar

@itsjoshbruce

Ooh, sounds interesting. Is it a private thing, or is it something that you could make available?

I've toyed with the idea of creating a custom UI builder, but I've got enough side projects. 😄

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@jitterted: Sure! Thanks for asking: https://github.com/8fold/php-html-builder

Part of the inspiration was also removing tokenized parsing of HTML. So, instead of “get PHP out HTML” it was “get HTML out of PHP” - it’s basically just string concatenation. lol

Very little code (a few hundred lines), and should be easy to port without becoming a full-blown project. A stable and complete build. I haven’t needed to tinker with it for years.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ngwrru68w68
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • GTA5RPClips
  • Youngstown
  • everett
  • slotface
  • rosin
  • osvaldo12
  • mdbf
  • kavyap
  • cubers
  • megavids
  • modclub
  • normalnudes
  • tester
  • khanakhh
  • Durango
  • ethstaker
  • tacticalgear
  • Leos
  • provamag3
  • anitta
  • cisconetworking
  • JUstTest
  • lostlight
  • All magazines