Re: 'Form Builder'
| From: | Lin Yo-An | Date: | Wed, 17 Feb 2016 10:44:46 +0000 |
| Subject: | Re: 'Form Builder' | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-325402@lists.php.net to get a copy of this message | ||
In order to build forms automatically, we developed a library that can
build HTML forms automatically from the schema and can handle the
logics/validations.
https://github.com/c9s/ActionKit
The schema is something look like this:
class YourAction extends \ActionKit\Action{ function schema() {
$this->param('id') ->renderAs('HiddenInput');
$this->param('password') ->renderAs('PasswordInput');
$this->filterOut('hack','hack2','role'); }
}
Once you defined the schema, the server side can handle the input
validation and data processing.
The underlaying part is FormKit, which provides fluent API to build
widgets, and you can choose different layout class to layout your widgets:
https://github.com/c9s/FormKit
--
Best Regards,
Yo-An Lin