Koowa_Template
[ class tree: Koowa_Template ] [ index: Koowa_Template ] [ all elements ]

Class: KTemplateFilterForm

Source Location: /libraries/koowa/template/filter/form.php

Class Overview

KObject
   |
   --KTemplateFilterAbstract
      |
      --KTemplateFilterForm

Template write filter to handle form html elements


Author(s):

Implements interfaces:

Variables

Methods


Child classes:

Form Filter

Inherited Variables

Inherited Methods

Class: KTemplateFilterAbstract

KTemplateFilterAbstract::__construct()
Constructor.
KTemplateFilterAbstract::execute()
Command handler
KTemplateFilterAbstract::getPriority()
Get the priority of a behavior
KTemplateFilterAbstract::getTemplate()
Get the template object
KTemplateFilterAbstract::_initialize()
Initializes the options for the object
KTemplateFilterAbstract::_parseAttributes()
Method to extract key/value pairs out of a string with xml style attributes

Class: KObject

KObject::__construct()
Constructor
KObject::get()
Get the object properties
KObject::getHandle()
Get a handle for this object
KObject::getIdentifier()
Gets the service identifier.
KObject::getMethods()
Get a list of all the available methods
KObject::getService()
Get an instance of a class based on a class identifier only creating it if it does not exist yet.
KObject::inherits()
Checks if the object or one of it's mixin's inherits from a class.
KObject::mixin()
Mixin an object
KObject::set()
Set the object properties
KObject::_initialize()
Initializes the options for the object
KObject::__call()
Search the mixin method map and call the method or trigger an error
KObject::__clone()
Preform a deep clone of the object.

Class Details

[line 23]
Template write filter to handle form html elements

For forms that use a post method this filter adds a token to prevent CSRF. For forms that use a get method this filter adds the action url query params as hidden fields to comply with the html form standard.




Tags:

author:  Johan Janssens <johan@nooku.org>
see:  h-17.13.3.4


[ Top ]


Class Variables

$_token_name =

[line 37]

The form token name



Tags:

access:  protected

Type:   string


[ Top ]

$_token_value =

[line 30]

The form token value



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


constructor __construct [line 44]

KTemplateFilterForm __construct( [ $config = null])

Constructor.



Tags:

access:  public


Overrides KTemplateFilterAbstract::__construct() (Constructor.)

Parameters:

object An   $config   optional KConfig object with configuration options

[ Top ]

method write [line 105]

KTemplateFilterForm write( string &$text)

Add unique token field



Tags:

access:  public



Implementation of:
KTemplateFilterWrite::write()
Parse the text and filter it

Parameters:

string   &$text  

[ Top ]

method _initialize [line 60]

void _initialize( $config)

Initializes the options for the object

Called from __construct() as a first step of object instantiation.




Tags:

access:  protected


Overrides KTemplateFilterAbstract::_initialize() (Initializes the options for the object)

Parameters:

object An   $config   optional KConfig object with configuration options

[ Top ]

method _renderQuery [line 164]

string _renderQuery( array $query, [string $key = ''])

Recursive function that transforms the query array into a string of input elements



Tags:

return:  String of the html input elements
access:  protected


Parameters:

array   $query   Associative array of query information
string   $key   The name of the current input element

[ Top ]

method _tokenName [line 94]

string _tokenName( )

Get the session token name

Tokens are used to secure forms from spamming attacks. Once a token has been generated the system will check the post request to see if it is present, if not it will invalidate the session.




Tags:

return:  The session token
access:  protected


[ Top ]

method _tokenValue [line 80]

string _tokenValue( [boolean $force = false])

Get the session token value.

If a token isn't set yet one will be generated. Tokens are used to secure forms from spamming attacks. Once a token has been generated the system will check the post request to see if it is present, if not it will invalidate the session.




Tags:

return:  The session token
access:  protected


Overridden in child classes as:

ComDefaultTemplateFilterForm::_tokenValue()

Parameters:

boolean   $force   If true, force a new token to be created

[ Top ]


Documentation generated on Mon, 20 May 2013 03:02:25 +0200 by phpDocumentor 1.4.3