class JHtmlForm

Utility class for form elements

Methods

static  string
token( array $attribs = array())

Displays a hidden token field to reduce the risk of CSRF exploits

static  void
csrf( string $name = 'csrf.token')

Add CSRF form token to Joomla script options that developers can get it by Javascript.

Details

static string token( array $attribs = array())

Displays a hidden token field to reduce the risk of CSRF exploits

Use in conjunction with JSession::checkToken()

Parameters

array $attribs Input element attributes.

Return Value

string A hidden input field with a token

See also

JSession::checkToken()

static void csrf( string $name = 'csrf.token')

Add CSRF form token to Joomla script options that developers can get it by Javascript.

Parameters

string $name The script option key name.

Return Value

void