Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
hidden.php
Aller à la documentation de ce fichier.
1 <?php
2 /**
3  * @package Joomla.Platform
4  * @subpackage Form
5  *
6  * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
7  * @license GNU General Public License version 2 or later; see LICENSE
8  */
9 
10 defined('JPATH_PLATFORM') or die;
11 
12 /**
13  * Form Field class for the Joomla Platform.
14  * Provides a hidden field
15  *
16  * @package Joomla.Platform
17  * @subpackage Form
18  * @link http://www.w3.org/TR/html-markup/input.hidden.html#input.hidden
19  * @since 11.1
20  */
22 {
23  /**
24  * The form field type.
25  *
26  * @var string
27  * @since 11.1
28  */
29  protected $type = 'Hidden';
30 
31  /**
32  * Method to get the field input markup.
33  *
34  * @return string The field input markup.
35  *
36  * @since 11.1
37  */
38  protected function getInput()
39  {
40  // Initialize some field attributes.
41  $class = !empty($this->class) ? ' class="' . $this->class . '"' : '';
42  $disabled = $this->disabled ? ' disabled' : '';
43 
44  // Initialize JavaScript field attributes.
45  $onchange = $this->onchange ? ' onchange="' . $this->onchange . '"' : '';
46 
47  return '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '" value="'
48  . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $disabled . $onchange . ' />';
49  }
50 }