~chroot64bit/zivios/gentoo-experimental

« back to all changes in this revision

Viewing changes to application/library/Zend/View/Helper/FormHidden.php

  • Committer: Mustafa A. Hashmi
  • Date: 2008-12-04 13:32:21 UTC
  • Revision ID: mhashmi@zivios.org-20081204133221-0nd1trunwevijj38
Inclusion of new installation framework with ties to zend layout and dojo layout

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Zend Framework
 
4
 *
 
5
 * LICENSE
 
6
 *
 
7
 * This source file is subject to the new BSD license that is bundled
 
8
 * with this package in the file LICENSE.txt.
 
9
 * It is also available through the world-wide-web at this URL:
 
10
 * http://framework.zend.com/license/new-bsd
 
11
 * If you did not receive a copy of the license and are unable to
 
12
 * obtain it through the world-wide-web, please send an email
 
13
 * to license@zend.com so we can send you a copy immediately.
 
14
 *
 
15
 * @category   Zend
 
16
 * @package    Zend_View
 
17
 * @subpackage Helper
 
18
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 
19
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 
20
 */
 
21
 
 
22
 
 
23
/**
 
24
 * Abstract class for extension
 
25
 */
 
26
require_once 'Zend/View/Helper/FormElement.php';
 
27
 
 
28
 
 
29
/**
 
30
 * Helper to generate a "hidden" element
 
31
 *
 
32
 * @category   Zend
 
33
 * @package    Zend_View
 
34
 * @subpackage Helper
 
35
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 
36
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 
37
 */
 
38
class Zend_View_Helper_FormHidden extends Zend_View_Helper_FormElement
 
39
{
 
40
    /**
 
41
     * Generates a 'hidden' element.
 
42
     *
 
43
     * @access public
 
44
     *
 
45
     * @param string|array $name If a string, the element name.  If an
 
46
     * array, all other parameters are ignored, and the array elements
 
47
     * are extracted in place of added parameters.
 
48
     * @param mixed $value The element value.
 
49
     * @param array $attribs Attributes for the element tag.
 
50
     * @return string The element XHTML.
 
51
     */
 
52
    public function formHidden($name, $value = null, array $attribs = null)
 
53
    {
 
54
        $info = $this->_getInfo($name, $value, $attribs);
 
55
        extract($info); // name, value, attribs, options, listsep, disable
 
56
        if (isset($id)) {
 
57
            if (isset($attribs) && is_array($attribs)) {
 
58
                $attribs['id'] = $id;
 
59
            } else {
 
60
                $attribs = array('id' => $id);
 
61
            }
 
62
        }
 
63
        return $this->_hidden($name, $value, $attribs);
 
64
    }
 
65
}