tempest-framework icon indicating copy to clipboard operation
tempest-framework copied to clipboard

Form builder

Open brendt opened this issue 1 year ago • 6 comments

We need a proper way of building forms. No idea how to do it yet.

brendt avatar May 30 '24 12:05 brendt

Can you provide more details on this?

binkapS avatar Aug 15 '24 15:08 binkapS

Well since I've made this issue, I've also implemented view components: https://tempest.stitcher.io/framework/04-views#content-view-components

On top of that, I've made a handful of components that are shipped with the framework: https://github.com/tempestphp/tempest-framework/tree/main/src/Tempest/View/Components

I reckon the "form builder" will consist of improved versions of these components.

brendt avatar Aug 16 '24 05:08 brendt

  1. Would it support custom themes?
  2. What's the scope? Is it primarily to show native HTML5 form elements but with model values and old values filled in automatically like Rails?
<%= simple_form_for @post do |f| %>
  <%= f.label :title, "Title" %>
  <%= f.input :title %>
  <%= f.label :content, "Content" %>
  <%= f.input :content %>
  <%= f.button :submit, "Create" %>
<% end %>

osbre avatar Nov 15 '24 16:11 osbre

The idea is that you'll be able to publish these components if you want custom themes. That functionality is not added yet though

brendt avatar Nov 16 '24 06:11 brendt

My personal opinion is that this would be better being a separate first-party package instead.

erikaraujo avatar Apr 09 '25 16:04 erikaraujo

I think this should be first-party if lightweight, eg. just a few good headless components to facilitate working with errors, CSRF etc

innocenzi avatar Apr 09 '25 18:04 innocenzi

We actually have a base for this now.

brendt avatar Oct 04 '25 05:10 brendt