Merge remote branch 'mvrhov/email_type' into mvrhov_merge
This commit is contained in:
commit
23e9ad7a99
@ -25,7 +25,7 @@
|
||||
<service id="form.factory" class="%form.factory.class%">
|
||||
<argument type="service" id="form.type.loader" />
|
||||
<!--
|
||||
All services with tag "form.guesser" are inserted here by
|
||||
All services with tag "form.guesser" are inserted here by
|
||||
AddFormGuessersPass
|
||||
-->
|
||||
<argument type="collection" />
|
||||
@ -36,7 +36,7 @@
|
||||
<tag name="form.guesser" />
|
||||
<argument type="service" id="validator.mapping.class_metadata_factory" />
|
||||
</service>
|
||||
|
||||
|
||||
<!-- CsrfProvider -->
|
||||
<service id="form.csrf_provider" class="%form.csrf_provider.class%">
|
||||
<argument type="service" id="session" />
|
||||
@ -50,17 +50,17 @@
|
||||
<argument>%file.temporary_storage.nesting_levels%</argument>
|
||||
<argument>%file.temporary_storage.directory%</argument>
|
||||
</service>
|
||||
|
||||
|
||||
<!-- ContainerAwareTypeLoader -->
|
||||
<service id="form.type.loader" class="%form.type.loader.class%">
|
||||
<argument type="service" id="service_container" />
|
||||
<!--
|
||||
All services with tag "form.type" are inserted here by
|
||||
All services with tag "form.type" are inserted here by
|
||||
AddFormTypesPass
|
||||
-->
|
||||
<argument type="collection" />
|
||||
</service>
|
||||
|
||||
|
||||
<!-- FieldTypes -->
|
||||
<service id="form.type.field" class="Symfony\Component\Form\Type\FieldType">
|
||||
<tag name="form.type" alias="field" />
|
||||
@ -94,6 +94,9 @@
|
||||
<service id="form.type.datetime" class="Symfony\Component\Form\Type\DateTimeType">
|
||||
<tag name="form.type" alias="datetime" />
|
||||
</service>
|
||||
<service id="form.type.email" class="Symfony\Component\Form\Type\EmailType">
|
||||
<tag name="form.type" alias="email" />
|
||||
</service>
|
||||
<service id="form.type.file" class="Symfony\Component\Form\Type\FileType">
|
||||
<tag name="form.type" alias="file" />
|
||||
<argument type="service" id="file.temporary_storage" />
|
||||
@ -143,6 +146,6 @@
|
||||
<service id="form.type.url" class="Symfony\Component\Form\Type\UrlType">
|
||||
<tag name="form.type" alias="url" />
|
||||
</service>
|
||||
|
||||
|
||||
</services>
|
||||
</container>
|
||||
|
@ -0,0 +1,7 @@
|
||||
<input type="email"
|
||||
<?php echo $view['form']->attributes() ?>
|
||||
name="<?php echo $view->escape($name) ?>"
|
||||
value="<?php echo $view->escape($value) ?>"
|
||||
<?php if ($read_only): ?>disabled="disabled"<?php endif ?>
|
||||
<?php if ($required): ?>required="required"<?php endif ?>
|
||||
/>
|
@ -256,3 +256,10 @@
|
||||
</div>
|
||||
{% endspaceless %}
|
||||
{% endblock form__widget %}
|
||||
|
||||
{% block email__widget %}
|
||||
{% spaceless %}
|
||||
{% set type = type|default('email') %}
|
||||
{{ block('field__widget') }}
|
||||
{% endspaceless %}
|
||||
{% endblock email__widget %}
|
28
src/Symfony/Component/Form/Type/EmailType.php
Normal file
28
src/Symfony/Component/Form/Type/EmailType.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\FormBuilder;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
|
||||
class EmailType extends AbstractType
|
||||
{
|
||||
public function getParent(array $options)
|
||||
{
|
||||
return 'field';
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'email';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user