FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Forge Class Reference
Inheritance diagram for Forge:
Form_Group

Public Member Functions

 __construct ($action=NULL, $title= '', $method=NULL, $attr=array())
 Form constructor.
 __get ($key)
 Magic __get method.
 __call ($method, $args)
 Magic __call method.
 set_attr ($key, $val=NULL)
 Set a form attribute.
 validate ()
 Validates the form by running each inputs validation rules.
 as_array ($clean=TRUE)
 Returns the form as an array of input names and values.
 error_format ($string= '')
 Changes the error message format.
 html ($template= 'forge_template', $custom=FALSE)
 Creates the form HTML.
 __toString ()
 Returns the form HTML.

Public Attributes

 $inputs = array()
 $hidden = array()
 $error_format = '<p class="error">{message}</p>'
 $newline_char = "\n"
 $visible = NULL

Protected Attributes

 $template
 $attr = array()

Constructor & Destructor Documentation

Forge::__construct (   $action = NULL,
  $title = '',
  $method = NULL,
  $attr = array() 
)

Form constructor.

Sets the form action, title, method, and attributes.

Returns
void

Member Function Documentation

Forge::__call (   $method,
  $args 
)

Magic __call method.

Creates a new form element object.

Exceptions
Kohana_Exception
Parameters
stringinput type
stringinput name
Returns
object
Forge::__get (   $key)

Magic __get method.

Returns the specified form element.

Parameters
stringunique input name
Returns
object

Reimplemented in Form_Group.

Forge::as_array (   $clean = TRUE)

Returns the form as an array of input names and values.

Parameters
booleanclean If set to TRUE (default) returned values are escaped Otherwise they are not.
Returns
array
Forge::error_format (   $string = '')

Changes the error message format.

Your message formatting must contain a {message} placeholder.

Exceptions
Kohana_Exception
Parameters
stringnew message format
Returns
void
Forge::html (   $template = 'forge_template',
  $custom = FALSE 
)

Creates the form HTML.

Parameters
stringform view template name
booleanuse a custom view
Returns
string

Reimplemented in Form_Group.

Forge::set_attr (   $key,
  $val = NULL 
)

Set a form attribute.

This method is chainable.

Parameters
string|arrayattribute name, or an array of attributes
stringattribute value
Returns
object
Forge::validate ( )

Validates the form by running each inputs validation rules.

Returns
bool

Member Data Documentation

Forge::$template
protected
Initial value:
array
(
'title' => '',
'class' => '',
'open' => '',
'close' => '',
)

The documentation for this class was generated from the following file: