PHP Class Newscoop\Form\Element\OldHash

Inheritance: extends Zend_Form_Element_Xhtm\Zend_Form_Element_Xhtml
Show file Open project: sourcefabric/newscoop

Public Properties

Property Type Description
$helper string Use formHidden view helper by default

Protected Properties

Property Type Description
$_hash mixed Actual hash used.

Public Methods

Method Description
__construct ( string | array | Zend_Config $spec, array | Zend_Config $options = null ) : void Constructor
getHash ( ) : string Retrieve CSRF token
getLabel ( ) : null Override getLabel() to always be empty
initCsrfValidator ( ) : Zend_Form_Element_Hash Initialize CSRF validator
render ( Zend_View_Interface $view = null ) : string Render CSRF token in form

Method Details

__construct() public method

Creates session namespace for CSRF token, and adds validator for CSRF token.
public __construct ( string | array | Zend_Config $spec, array | Zend_Config $options = null ) : void
$spec string | array | Zend_Config
$options array | Zend_Config
return void

getHash() public method

If no CSRF token currently exists, generates one.
public getHash ( ) : string
return string

getLabel() public method

Override getLabel() to always be empty
public getLabel ( ) : null
return null

initCsrfValidator() public method

Creates Session namespace, and initializes CSRF token in session. Additionally, adds validator for validating CSRF token.
public initCsrfValidator ( ) : Zend_Form_Element_Hash
return Zend_Form_Element_Hash

render() public method

Render CSRF token in form
public render ( Zend_View_Interface $view = null ) : string
$view Zend_View_Interface
return string

Property Details

$_hash protected property

Actual hash used.
protected mixed $_hash
return mixed

$helper public property

Use formHidden view helper by default
public string $helper
return string