2017 © Pedro Peláez
 

library form-field

Render HTML form fields

image

grottopress/form-field

Render HTML form fields

  • Thursday, July 19, 2018
  • by akadusei
  • Repository
  • 2 Watchers
  • 1 Stars
  • 184 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 56 % Grown

The README.md

Form Field

Render HTML form field., (*1)

Usage

Install via composer:, (*2)

composer require grottopress/form-field`

Instantiate and use thus:, (*3)

<?php
declare (strict_types = 1);

use GrottoPress\Form\Field;

// Text field
$text = new Field([
    'id' => 'field-id',
    'name' => 'field-name',
    'type' => 'text',
    'value' => 'My awesome text field',
    'label' => 'My text field',
]);

// Render text field
echo $text->render();

// Radio buttons
$radio = new Field([
    'id' => 'field-id',
    'name' => 'field-name',
    'type' => 'radio',
    'value' => 'my-choice',
    'choices' => [
        'one' => 'One',
        'my-choice' => 'My Choice',
        'two' => 'Two',
    ],
]);

// Render radio field
echo $radio->render();

// Dropdown
$dropdown = new Field([
    'id' => 'field-id',
    'name' => 'field-name',
    'type' => 'select',
    'value' => 'my-choice',
    'choices' => [
        'one' => 'One',
        'my-choice' => 'My Choice',
        'two' => 'Two',
    ],
]);

// Render dropdown field
echo $dropdown->render();

// Multi-select dropdown
$mdrop = new Field([
    'id' => 'field-id',
    'name' => 'field-name[]',
    'type' => 'radio',
    'value' => 'my-choice',
    'choices' => [
        'one' => 'One',
        'my-choice' => 'My Choice',
        'two' => 'Two',
    ],
    'meta' => [
        'multiple' => 'multiple',
    ],
]);

// Render multi-select dropdown
echo $mdrop->render();

Development

Run tests with composer run test., (*4)

Contributing

  1. Fork it
  2. Switch to the master branch: git checkout master
  3. Create your feature branch: git checkout -b my-new-feature
  4. Make your changes, updating changelog and documentation as appropriate.
  5. Commit your changes: git commit
  6. Push to the branch: git push origin my-new-feature
  7. Submit a new Pull Request against the GrottoPress:master branch.

The Versions

19/07 2018

dev-master

9999999-dev

Render HTML form fields

  Sources   Download

MIT

The Requires

 

The Development Requires

form html field forms

19/07 2018

dev-dev

dev-dev

Render HTML form fields

  Sources   Download

MIT

The Requires

 

The Development Requires

form html field forms

19/07 2018

0.6.1

0.6.1.0

Render HTML form fields

  Sources   Download

MIT

The Requires

 

The Development Requires

html forms

05/07 2018

0.6.0

0.6.0.0

Render HTML form fields

  Sources   Download

MIT

The Requires

 

The Development Requires

html forms

06/03 2018

0.5.0

0.5.0.0

Render HTML form fields

  Sources   Download

MIT

The Requires

 

The Development Requires

html forms

03/03 2018

0.4.1

0.4.1.0

Render HTML form fields

  Sources   Download

MIT

The Requires

 

The Development Requires

html forms

02/03 2018

0.4.0

0.4.0.0

Render HTML form fields

  Sources   Download

MIT

The Requires

 

The Development Requires

html forms

20/11 2017

0.3.2

0.3.2.0

A library to render HTML form fields.

  Sources   Download

MIT

The Requires

 

The Development Requires

form html field

16/11 2017

0.3.1

0.3.1.0

A library to render HTML form fields.

  Sources   Download

MIT

The Requires

 

The Development Requires

form html field

28/09 2017

0.3.0

0.3.0.0

A library to render HTML form fields.

  Sources   Download

MIT

The Requires

 

The Development Requires

form html field

13/09 2017

0.2.0

0.2.0.0

A library to render HTML form fields.

  Sources   Download

MIT

The Requires

 

The Development Requires

form html field

25/08 2017

0.1.1

0.1.1.0

A library to render HTML form fields.

  Sources   Download

MIT

The Requires

 

The Development Requires

form html field

13/08 2017

0.1.0

0.1.0.0

A library to render HTML form fields.

  Sources   Download

MIT

The Requires

 

The Development Requires

form html field