Recommend this page to a friend!
  Classes of Leonardo Mauro Pereira Moraes  >  FPHP Fields  >  >  Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: FPHP Fields
Compose and render forms defined programmatically
Author: By
Last change: update LICENSE
Date: 2 years ago
Size: 2,469 bytes


Class file image Download


Links: PHP Classes and Github

Simple Online Example and Bootstrap Online Example

Class from package FPHP.

Feature: Have a automatic integration with jquery.validate.js methods for all fields.


This class can compose in PHP and render in HTML standard fields forms, like: checkbox, radio, inputs, select, textarea and button. Each field have your specific class, and you can modify and customize with your styles (have an example with Bootstrap). Also include a class with error parser, case you access any class/function using absence or wrong values.


  |__ /fphp/
  |     |__ /fields/
  |            |__ ErrorParserFields.php
  |            |__ FieldInterface.php
  |            |__ MasterFields.php
  |            |__ InputField.php
  |            |__ BoxesField.php
  |            |__ SelectField.php
  |            |__ TextareaField.php
  |            |__ ButtonField.php
  |            |__ FormField.php
  |__ /example/

  |__ jquery.min.js
  |__ /validate/
        |__ jquery.validate.min.js
        |__ jquery.validate-auto.js
        |__ jquery.validate-messages-pt-br.js

  • /php/fphp/fields/: Classes to render each field and error parser;
  • jquery.validate-auto.js: automatic the validation;
  • jquery.validate-messages-pt-br.js: change the messages to portuguese language;



Example: Litle example to show some methods. See others examples in ./example/

use \FPHP\Fields\InputField;
use \FPHP\Fields\FormField;

$input = new InputField('text', array('name'=>'full_name', 'validate'=>['required'=>true, 'minlength'=>10]), 'Name');
//$input->construct_field();	//<= echo the 'input' tag
//$input->get_field();			//<= get the 'input' tag

$form = new FormField(array('action'=>'#', 'method'=>'get', 'name'=>'form_example'));


Also look ~

For more information send a message to info at phpclasses dot org.