PHP Class Grunion_Contact_Form_Field, jetpack

Parses shortcode to output the contact form field as HTML. Validates input.
Inheritance: extends Crunion_Contact_Form_Shortcode
Mostra file Open project: automattic/jetpack Class Usage Examples

Public Properties

Property Type Description
$error Is the input invalid?
$form parent form
$shortcode_name
$value default or POSTed value

Public Methods

Method Description
__construct ( array $attributes, null | string $content = null, Grunion_Contact_Form $form = null )
add_error ( string $message ) This field's input is invalid. Flag as invalid and add an error to the parent form
is_error ( ) : boolean Is the field input invalid?
render ( ) : string Outputs the HTML for this form field
validate ( ) Validates the form input

Method Details

__construct() public method

public __construct ( array $attributes, null | string $content = null, Grunion_Contact_Form $form = null )
$attributes array An associative array of shortcode attributes. @see shortcode_atts()
$content null | string Null for selfclosing shortcodes. The inner content otherwise.
$form Grunion_Contact_Form The parent form

add_error() public method

This field's input is invalid. Flag as invalid and add an error to the parent form
public add_error ( string $message )
$message string The error message to display on the form.

is_error() public method

Is the field input invalid?
public is_error ( ) : boolean
return boolean

render() public method

Outputs the HTML for this form field
public render ( ) : string
return string HTML

validate() public method

Validates the form input
public validate ( )

Property Details

$error public_oe property

Is the input invalid?
public $error

$form public_oe property

parent form
public $form

$shortcode_name public_oe property

public $shortcode_name

$value public_oe property

default or POSTed value
public $value