2017 © Pedro Peláez
 

library form

Form component allows you to easily create HTML forms.

image

flextype-components/form

Form component allows you to easily create HTML forms.

  • Sunday, May 13, 2018
  • by Awilum
  • Repository
  • 1 Watchers
  • 0 Stars
  • 63 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 110 % Grown

The README.md

Form Component

version MIT License, (*1)

Form component allows you to easily create HTML forms., (*2)

Installation

composer require flextype-components/form

Usage

use Flextype\Component\Form\Form;

Registers a custom macro., (*3)

// Registering a Form macro
Form::macro('my_field', function() {
    return '<input type="text" name="my_field">';
});

// Calling a custom Form macro
echo Form::my_field();


// Registering a Form macro with parameters
Form::macro('my_field', function($value = '') {
    return '<input type="text" name="my_field" value="'.$value.'">';
});

// Calling a custom Form macro with parameters
echo Form::my_field('Flextype');

Create an opening HTML form tag., (*4)

// Form will submit back to the current page using POST
echo Form::open();

// Form will submit to 'search' using GET
echo Form::open('search', array('method' => 'get'));

// When "file" inputs are present, you must include the "enctype"
echo Form::open(null, array('enctype' => 'multipart/form-data'));

Create a form input. Text is default input type., (*5)

echo Form::input('username', $username);

Create a hidden form input., (*6)

echo Form::hidden('user_id', $user_id);

Creates a password form input., (*7)

echo Form::password('password');

Creates a file upload form input., (*8)

echo Form::file('image');

Creates a checkbox form input., (*9)

echo Form::checkbox('i_am_not_a_robot');

Creates a radio form input., (*10)

echo Form::radio('i_am_not_a_robot');

Creates a textarea form input., (*11)

echo Form::textarea('text', $text);

Creates a select form input., (*12)

echo Form::select('themes', array('default', 'classic', 'modern'));

Creates a submit form input., (*13)

echo Form::submit('save', 'Save');

Creates a button form input., (*14)

echo Form::button('save', 'Save Profile', array('type' => 'submit'));

Creates a form label., (*15)

echo Form::label('username', 'Username');

Create closing form tag., (*16)

echo Form::close();

License

See LICENSE, (*17)

The Versions

13/05 2018

dev-master

9999999-dev https://github.com/flextype-components/form

Form component allows you to easily create HTML forms.

  Sources   Download

MIT

The Requires

 

form

13/05 2018

v1.0.1

1.0.1.0 https://github.com/flextype-components/form

Form component allows you to easily create HTML forms.

  Sources   Download

MIT

The Requires

 

form

11/05 2018

v1.0.0

1.0.0.0 https://github.com/flextype-components/form

Form component allows you to easily create HTML forms.

  Sources   Download

MIT

The Requires

  • php ^7.1.3

 

form