2017 © Pedro Peláez
 

library form_builder

image

pails/form_builder

  • Friday, May 20, 2016
  • by bparks
  • Repository
  • 1 Watchers
  • 0 Stars
  • 193 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

pails-form-builder

A utility that makes building a form ridiculously easy., (*1)

Dependencies

None, (*2)

Installation

In the root of a pails app, run, (*3)

pails install form_builder

Configuration

Inside any controller where you want to make use of the form builder, use the FormBuilder trait., (*4)

class DefaultController extends Pails\Controller
{
    use PailsAuthentication;
}

Then, in the relevant views, you can call $this->input_for(), (*5)

string input_for(string data_name, string label, array options)

  • data_name - the name of the form element
  • label - the text that should accompany the form element
  • options - an array of options, depending on the type of element
    • type - (default: text) the type of input
      • list - select list, with options
      • textarea - a large textbox
      • radio - a set of radio buttons, with options
      • check - a set of checkboxes, with options
      • number - a number input type (with options, multiple)
      • text - a standard text input field
    • value - (default: empty string) the initial value of the element
    • tooltip - (default: empty string) the title attribute, provides additional information about the input
    • style - (default: empty string; textarea only) inline CSS styles
    • options - (default: array(); radio, check, list, and number only) an associative array of options. key is the input's value and the value is the text that should be displayed for that option
  • Returns: a string of HTML built with the corresponding options

Support

pails-form-builder is a core plugin supported by Synapse Software. Contact us at support@synapsesoftware.com., (*6)

The Versions

20/05 2016

dev-master

9999999-dev

  Sources   Download

20/05 2016

v1.0.3

1.0.3.0

  Sources   Download

17/05 2016

v1.0.2

1.0.2.0

  Sources   Download

23/11 2015

v1.0.1

1.0.1.0

  Sources   Download

04/07 2015

v1.0

1.0.0.0

  Sources   Download