Releases: ccuffs/poll-from-text
Releases · ccuffs/poll-from-text
v2.0.0
This is a major breaking change release that introduces new information when options are parsed. Shortly, options are now arrays with fields text
, marker
and separator
. See below the full changelog.
Changed
- Options are now arrays with fields
text
,marker
andseparator
.
Added
- Config entry
attr_validation
to control how attributes are validated.
v.1.0.1
v1.0.0
Initial public release! 🚀🥳 poll-from-text
is a PHP package to parse semi-structured text into structured-data that can be used to build questionnaires (forms). The main goal is to allow end users to build dynamic forms, e.g. Google Forms, using plain text like they would if the forms were to be printed on paper.
Usage:
$questions = CCUFFS\Text\PollFromText::make('Favorite color?')
var_dump($questions);
The output should be something like:
array(1) {
[0]=>
array(2) {
["text"]=>
string(15) "Favorite color?"
["type"]=>
string(5) "input"
}
}
Features for this release ✨:
- Simple input questions (useful to create
<input type="text" />
elements); - Question with options (useful to create
<select>
elements); - Options with no value (only text), e.g.
- Text
, or* Text
(like in<option>Text</option>
); - Options with a value, e.g
a) Text
(value is"a"
, like in<option value="a">Text</option>
); - Data attributes (as JSON objects) for both questions and options, e.g.
{"type":"file"} What?
(useful to create custom form elements such as<input type="file" />
).
Check the README for documentation.