EO_Booking_Form_Element_Factory
Pro
Factory for creating element instances.
Each element type is identified by a string identifier. The factory contains an internal
array, mapping that ID to the appropriate class. You can add or change an IDs element
class using the register method.
The factory allows you to create a booking form element instance, by suppling an array of
properties to the create method. The required properties will be depend on the instance type, but
must contain an 'id' and 'type'.
Methods
private |
#
backwards_combat( )
Method to handle the deprected method of modifying the factory's internal map.
|
public |
#
create( $parameters )
Creates an element instance
When adding an element, the ID must be unique. To avoid potential collisions with IDs used by core,
it’s recommended that you prefix every ID with an underscore.
$element = EO_Booking_Form_Element_Factory::create( array(
'id' => '_meal-choice',
'type' => 'select',
'required' => true,
'options' => array(
'lasagne' => 'Vegetarian lasagne',
'lamb' => 'Spiced Moroccan lamb',
'steak' => 'Steak & ale pie'
)
);
|
public |
#
register( $id, $class )
Add or change an element type
EO_Booking_Form_Element_Factory::register( 'my_elemnt_type', 'My_Element_Type' );
|
Properties
private
|
$types
|
|
private
|
$backwards_compat
|
|
Hooks