caolan / forms

An easy way to create, parse and validate forms in node.js
MIT License
1.01k stars 167 forks source link

Custom templates #180

Open Evanion opened 8 years ago

Evanion commented 8 years ago

This is the closest packages I have found for server side forms, compared to angular-formly is for angular apps, But I was wondering if there is any easy way to create custom markup templates for the package ..

It would allow me to configure the package to use a specific markup template for a project... since a project usually depends on a frontend framework like Bootstrap, foundation, or uikit.. It would be great if it was possible to just npm install this package, and a addon package for your frontend framework of choice, ad a option when bootrapping this package, and then just work with it as normal.

ljharb commented 8 years ago

You can construct your own widgets by following the same patterns the included widgets use.

iBelieve commented 8 years ago

Something like forms.configure('bootstrap') would be nice as a way to use pre-configured templates for common frameworks.

ljharb commented 8 years ago

Which version of bootstrap? I wouldn't want to add the maintenance burden of having to update this module with every bootstrap version - and https://github.com/caolan/forms#bootstrap-compatible-output hopefully already documents how to get bootstrap to work.

voxpelli commented 8 years ago

Something like forms.use(require('forms-bootstrap')) would enable this without the added maintenance of any single maintainer

Danita commented 4 years ago

I second this. I come from Symfony, using the excellent built-in forms and validator, and they just use a template for the widgets you can fully replace with whatever you want, instead of programmatically rendering them. You can just include the barest template possible and let the community to build specific templates for each UI framework.