Development

/branches/1.1/lib/widget/sfWidgetFormInput.class.php

You must first sign up to be able to contribute.

root/branches/1.1/lib/widget/sfWidgetFormInput.class.php

Revision 9046, 1.5 kB (checked in by FabianLange, 6 years ago)

1.1: fixed @param phpdoc to fit specs in widgets (refs #2991)

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 /**
12  * sfWidgetFormInput represents an HTML input tag.
13  *
14  * @package    symfony
15  * @subpackage widget
16  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
17  * @version    SVN: $Id$
18  */
19 class sfWidgetFormInput extends sfWidgetForm
20 {
21   /**
22    * Constructor.
23    *
24    * Available options:
25    *
26    *  * type: The widget type (text by default)
27    *
28    * @param array $options     An array of options
29    * @param array $attributes  An array of default HTML attributes
30    *
31    * @see sfWidgetForm
32    */
33   protected function configure($options = array(), $attributes = array())
34   {
35     $this->addOption('type', 'text');
36
37     $this->setOption('is_hidden', false);
38   }
39
40   /**
41    * @param  string $name        The element name
42    * @param  string $value       The value displayed in this widget
43    * @param  array  $attributes  An array of HTML attributes to be merged with the default HTML attributes
44    * @param  array  $errors      An array of errors for the field
45    *
46    * @return string An HTML tag string
47    *
48    * @see sfWidgetForm
49    */
50   public function render($name, $value = null, $attributes = array(), $errors = array())
51   {
52     return $this->renderTag('input', array_merge(array('type' => $this->getOption('type'), 'name' => $name, 'value' => $value), $attributes));
53   }
54 }
55
Note: See TracBrowser for help on using the browser.