Skip to content

Releases: ccuffs/poll-from-text

v2.0.0

03 Oct 22:46
0643c7c
Compare
Choose a tag to compare

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 and separator.

Added

  • Config entry attr_validation to control how attributes are validated.

v.1.0.1

23 Jun 11:07
Compare
Choose a tag to compare

This is a minor release with the addition of the static method CCUFFS\Text\PollFromText::make() which allows easy parsing without any instantiations. A few doc blocks were added here and there also.

v1.0.0

22 Jun 17:04
Compare
Choose a tag to compare

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.