mevdschee / php-crud-api

Single file PHP script that adds a REST API to a SQL database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML Middleware

apps-caraga opened this issue Β· comments

Not an issue, just a question. Can be closed immediately if considered irrelevant. 😁

I'm just been reading about htmx, how it supposedly simplifies things in webdev. I was just wondering if this API can also be used with htmx? Like, htmx needs a full or partial html document from the server, so would it be possible to have a middleware that produces that (html) instead of json or xml?

Awesome idea! It would need some examples I guess and a default representation (table for lists and dt/dd for records)?

Yep, a default representation of tabular data would be useful. Although from what I read so far from its docs, almost any valid html tag/document can be returned, so that may complicate things up