Download the PHP package apollo29/forms-engine without Composer
On this page you can find all versions of the php package apollo29/forms-engine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package forms-engine
FormsEngine
Library to build forms on basis of Bootstrap 4 templates. This library includes customizable templates to use also other frameworks than Bootstrap, has multilanguage support and configurable ways to persist the form data.
- Install
- Usage
- Dependencies
- Configuration
- set Prefix directory
- get Configuration variable
- Translations
- Templates
- Option
FormsEngine\Questions\Element\Option - Elements
FormsEngine\Questions\Element- Text, E-Mail, Number, Date, DateTime
- Textarea
- Hidden
- Typeahead
- Radio
- RadioGroup
- Checkbox
- CheckboxGroup
- Select
- YesNo
- Paragraph
- Title
- Button, Reset, Submit
- De-/Serialization of form definitions
FormsEngine\Questions\Loader - Pagination
FormsEngine\Questions\Pagination - API and Persistence
FormsEngine\Answers\Persistence- CSV
- JSON
- JSONDB
- MySQL
- XLSX
- Implement own Persistence
Install
Install using composer.
Usage
In your index.php you have to create a new FormsEngine instance first.
Then add some Elements to create your form, and render it.
Dependencies
A List of all Dependencies used by this Library.
CSS/JS
- bootstrap
- material
- jquery-typeahead
- Parsley.JS Input validation
- JOII (JavaScript Object Inheritance Implementation used for JS Objects of
FormsEngine\Questions\Element
PHP
- twig/twig templating
- myclabs/php-enum
- phpcollection/phpcollection Sets, Sequences, Collections
- philipp15b/php-i18n i18n
- slim/slim RESTful
- nategood/httpful HTTP calls
- league/csv CSV
- rakibtg/sleekdb JSONDB
- phpmailer/phpmailer E-Mail
- phpoffice/phpspreadsheet Excel
Configuration
Set a session var with name configFile and the path and json-filename of your own config.json. See below the standardconfig.json as an example. If your happy with the standard config.json, you don't need to set the session var.
config.json
set Prefix directory
todo
get Configuration variable
todo
Translations
todo
Templates
todo
Option FormsEngine\Questions\Element\Option
Used for RadioGroup, CheckboxGroup, Typeahead and Select Elements.
Usage
Public Methods
__construct()constructoradd($label, $value, $selected = false)add values toOptionElementaddAll($options)add an Array ofOptionElementsall()get All Elementsstatic create($label, $value, $selected = false)returns anOptionElementserialize()get serialized Element for persistence, array with all attributes and values.static deserialize($object)deserialize Object to Element
Private Methods
static camelCase($str, array $noStrip = [])get String camelCased, used forid
Elements FormsEngine\Questions\Element
All Elements are - mostly - standard HTML5 input fields and have the following methods:
Public Methods
___construct($label)when not otherwise stated, this is the default constructorserialize()get serialized Element for persistence, array with all attributes and values.prepare()seeserialize()static deserialize($object)deserialize Object to ElementtoObjectVar($key, $value, $class = null)used to map an array to key/value of Element.script()get all JavaScript code to render.required()set Element as requiredreadonly()set Element as readonlydisabled()set Element as disabledinputmask($mask,$type = 'mask')set Inputmask (see Dependencies for further Documentation)addStyle($style)add additional CSS classattr($attr, $value)add attributes
Private Methods
setId($id,$isName = false)set id and optional also name attributesetName($name)set name attributestatic camelCase($str, array $noStrip = [])get String camelCased, used forsetIdandsetName
Text, E-Mail, Number, Date, DateTime
Extends from Input
Usage
Template/HTML (type is different according to Element)
Public Methods
__construct($label, $placeholder = null, $helptext = null)constructorrender($twig)render Method for Twig Template Engine
Textarea
Extends from Input
Usage
Template/HTML
Public Methods
__construct($label, $helptext = null)constructorrender($twig)render Method for Twig Template Engine
Hidden
Extends from Element
Usage
Template/HTML
Public Methods
__construct($id, $value = null)constructorrender($twig)render Method for Twig Template Engine
Typeahead
Extends from Text
Usage, with Array
Usage, with Option. See Option for more information
Template/HTML
Public Methods
__construct($label, $options, $placeholder = null, $helptext = null)constructorrender($twig)render Method for Twig Template Engine
Radio
Extends from Element
Usage
Template/HTML
Public Methods
__construct($label, $value, $name, $checked = false)constructorrender($twig)render Method for Twig Template Engine
RadioGroup
Extends from Element
Usage, see Option for more information
Template/HTML
Public Methods
__construct($label, $options, $name = null)constructorrender($twig)render Method for Twig Template Engine
Checkbox
Extends from Element
Usage
Template/HTML
Public Methods
__construct($label, $value, $checked = false)constructorrender($twig)render Method for Twig Template Engine
CheckboxGroup
Extends from Element
Usage, see Option for more information
Template/HTML
Public Methods
__construct($label, $options)constructorrender($twig)render Method for Twig Template EngineelementKeys()allOptionKeys
Select
Extends from Element
Usage, see Option for more information
Template/HTML
Public Methods
__construct($label,$options,$nullable = false,$helptext = null)constructorrender($twig)render Method for Twig Template Engine
YesNo
Renders a Yes/No Radio Element, with "Yes" / "No" or boolean values.
Extends from ElementGroup
Usage
Template/HTML, see Radio Element
Public Methods
__construct($name, $booleans = false)constructorrender($twig)render Method for Twig Template Engine
Paragraph
Extends from Element
Usage
Template/HTML
Public Methods
__construct($title=null,$description=null)constructorrender($twig)render Method for Twig Template Engine
Title
There is only one Title Element allowed per Form.
Extends from Paragraph
Usage
Template/HTML
Public Methods
__construct($title,$description=null)constructorrender($twig)render Method for Twig Template Engine
Button, Reset, Submit
See #26.
Extends from Element
Usage
Template/HTML
Public Methods
__construct($label,$buttonType=null)constructorrender($twig)render Method for Twig Template Engine
De-/Serialization of form definitions FormsEngine\Questions\Loader
todo
Pagination FormsEngine\Questions\Pagination
todo
API and Persistence FormsEngine\Answers\Persistence
todo
CSV
JSON
JSONDB
MySQL
XLSX
Implement own Persistence
All versions of forms-engine with dependencies
ext-json Version ^1.5
myclabs/php-enum Version ^1.7
twig/twig Version ^2.0
phpcollection/phpcollection Version ^0.5.0
league/csv Version ^9.2
philipp15b/php-i18n Version ^4.0
phpmailer/phpmailer Version ^6.0
nategood/httpful Version ^0.2.20
slim/slim Version ^3.12
vlucas/phpdotenv Version ^3.4
tuupola/slim-jwt-auth Version ^3.4
rakibtg/sleekdb Version ^1.0