1 <?php
 2 /**
 3  * @package     Joomla.Libraries
 4  * @subpackage  HTML
 5  *
 6  * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 7  * @license     GNU General Public License version 2 or later; see LICENSE.txt
 8  */
 9 
10 defined('JPATH_PLATFORM') or die;
11 
12 /**
13  * Utility class for form elements
14  *
15  * @since  1.5
16  */
17 abstract class JHtmlForm
18 {
19     /**
20      * Displays a hidden token field to reduce the risk of CSRF exploits
21      *
22      * Use in conjunction with JSession::checkToken()
23      *
24      * @return  string  A hidden input field with a token
25      *
26      * @see     JSession::checkToken()
27      * @since   1.5
28      */
29     public static function token()
30     {
31         return '<input type="hidden" name="' . JSession::getFormToken() . '" value="1" />';
32     }
33 }
34