123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- /*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
- *
- * For the full copyright and license infieldation, please view the LICENSE
- * file that was distributed with this source code.
- */
- namespace Symfony\Component\Form\Renderer\Plugin;
- use Symfony\Component\Form\Renderer\RendererInterface;
- use Symfony\Component\Form\FieldInterface;
- class MaxLengthPlugin implements PluginInterface
- {
- private $maxLength;
- public function __construct($maxLength)
- {
- $this->maxLength = $maxLength;
- }
- /**
- * Renders the HTML enctype in the field tag, if necessary
- *
- * Example usage in Twig templates:
- *
- * <field action="..." method="post" {{ field.render.enctype }}>
- *
- * @param Form $field The field for which to render the encoding type
- */
- public function setUp(RendererInterface $renderer)
- {
- $renderer->setVar('max_length', $this->maxLength);
- }
- }
|