Added the possibility to register
This commit is contained in:
@@ -30,6 +30,10 @@ KekRozsak\FrontBundle\Entity\User:
|
||||
targetEntity: ForumPost
|
||||
mappedBy: created_by
|
||||
fetch: EXTRA_LAZY
|
||||
manyToOne:
|
||||
accepted_by:
|
||||
targetEntity: User
|
||||
fetch: EXTRA_LAZY
|
||||
manyToMany:
|
||||
roles:
|
||||
targetEntity: Role
|
||||
|
@@ -11,3 +11,7 @@ services:
|
||||
doctrine: @doctrine
|
||||
tags:
|
||||
- { name: twig.extension }
|
||||
form.type_extension.help_message:
|
||||
class: KekRozsak\FrontBundle\Form\Extension\HelpMessageTypeExtension
|
||||
tags:
|
||||
- { name: "form.type_extension", alias: "field" }
|
||||
|
29
src/KekRozsak/FrontBundle/Resources/config/validation.yml
Normal file
29
src/KekRozsak/FrontBundle/Resources/config/validation.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
KekRozsak\FrontBundle\Entity\User:
|
||||
constraints:
|
||||
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
|
||||
fields: username
|
||||
message: "Ez a felhasználónév már foglalt. Kérlek, válassz egy másikat!"
|
||||
groups: [ registration ]
|
||||
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
|
||||
fields: email
|
||||
message: "Ez az e-mail cím már foglalt. Kérlek, válassz egy másikat!"
|
||||
groups: [ registration ]
|
||||
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
|
||||
fields: display_name
|
||||
message: "Ez a név már foglalt. Kérlek, válassz egy másikat!"
|
||||
groups: [ registration ]
|
||||
properties:
|
||||
username:
|
||||
- NotBlank: { groups: [ registration ] }
|
||||
password:
|
||||
- NotBlank: { groups: [ registration ] }
|
||||
email:
|
||||
- NotBlank: { groups: [ registration ] }
|
||||
- Email: { groups: [ registration ] }
|
||||
registered_at:
|
||||
- NotBlank: ~
|
||||
- Type: \DateTime
|
||||
display_name:
|
||||
- NotBlank: { groups: [ registration ] }
|
||||
KekRozsak\FrontBundle\Form\Type\UserType:
|
||||
|
@@ -0,0 +1,10 @@
|
||||
{% block field_row %}
|
||||
<tr>
|
||||
<td>{{ form_label(form) }}</td>
|
||||
<td>{{ form_widget(form) }}</td>
|
||||
<td>
|
||||
{{ help }}
|
||||
</td>
|
||||
<td>{{ form_errors(form) }}</td>
|
||||
</td>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user