1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace Symfony\Component\Form;
- /*
- * This file is part of the Symfony framework.
- *
- * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
- /**
- * A text input field.
- *
- * @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
- */
- class TextField extends InputField
- {
- /**
- * {@inheritDoc}
- */
- protected function configure()
- {
- parent::configure();
- $this->addOption('max_length');
- }
- /**
- * {@inheritDoc}
- */
- public function render(array $attributes = array())
- {
- return parent::render(array_merge(array(
- 'type' => 'text',
- 'maxlength' => $this->getOption('max_length'),
- ), $attributes));
- }
- }
|