Skip to content

Commit 113cc4e

Browse files
authored
Merge pull request #2189 from michaelcullum/task/code-block-consistency
Fix code block consistency
2 parents 5195070 + 6a368c8 commit 113cc4e

6 files changed

+52
-17
lines changed

Resources/doc/adding_invitation_registration.rst

+15
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Invitation model
1111
First we need to add the invitation entity. An invitation is represented
1212
by a unique code/identifier generated in the constructor::
1313

14+
<?php
15+
// src/AppBundle/Entity/Invitation.php
16+
1417
namespace AppBundle\Entity;
1518

1619
use Doctrine\ORM\Mapping as ORM;
@@ -67,6 +70,9 @@ by a unique code/identifier generated in the constructor::
6770

6871
Next we map our ``Invitation`` entity to our ``User`` with a one-to-one association::
6972

73+
<?php
74+
// src/AppBundel/Entity/User.php
75+
7076
namespace AppBundle\Entity;
7177

7278
use Doctrine\ORM\Mapping as ORM;
@@ -101,6 +107,9 @@ Add invitation to RegistrationFormType
101107

102108
Override the default registration form with your own::
103109

110+
<?php
111+
// src/AppBundle/Form/RegistrationFormType.php
112+
104113
namespace AppBundle\Form;
105114

106115
use Symfony\Component\Form\AbstractType;
@@ -126,6 +135,9 @@ Override the default registration form with your own::
126135

127136
Create the invitation field::
128137

138+
<?php
139+
// src/AppBundle/Form/InvitationFormType.php
140+
129141
namespace AppBundle\Form;
130142

131143
use Symfony\Component\Form\AbstractType;
@@ -169,6 +181,9 @@ Create the invitation field::
169181

170182
Create the custom data transformer::
171183

184+
<?php
185+
// src/AppBundle/Form/InvitationToCodeTransformer.php
186+
172187
namespace AppBundle\Form\DataTransformer;
173188

174189
use AppBundle\Entity\Invitation;

Resources/doc/emails.rst

+10-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ implementation instead. It expects your twig template to define 3 blocks:
114114
- ``body_text`` rendering the plain text version of the message
115115
- ``body_html`` rendering the html mail
116116

117-
Here is how you can use it:
117+
Here is how you can use it, you can use either of the two methods
118+
of referencing the email template below.
118119

119120
.. code-block:: yaml
120121
@@ -125,7 +126,10 @@ Here is how you can use it:
125126
mailer: fos_user.mailer.twig_swift
126127
resetting:
127128
email:
128-
template: email/password_resetting.email.twig
129+
template: email/password_resetting.email.twig
130+
registration:
131+
confirmation:
132+
template: FOSUserBundle:Registration:email.txt.twig
129133
130134
.. code-block:: html+jinja
131135

@@ -158,6 +162,10 @@ Here is how you can use it:
158162
The HTML part is set in the message only when the ``body_html`` block is
159163
not empty.
160164

165+
You can view the default email templates at
166+
`FOSUserBundle:Registration:email.txt.twig` and
167+
`FOSUserBundle:Resetting:email.txt.twig`
168+
161169
Using A Custom Mailer
162170
---------------------
163171

Resources/doc/groups.rst

+21-15
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ a) ORM Group class implementation
6060

6161
.. code-block:: php-annotations
6262
63-
// src/MyProject/MyBundle/Entity/Group.php
63+
<?php
64+
// src/AppBundle/Entity/Group.php
6465
65-
namespace MyProject\MyBundle\Entity;
66+
namespace AppBundle\Entity;
6667
6768
use FOS\UserBundle\Entity\Group as BaseGroup;
6869
use Doctrine\ORM\Mapping as ORM;
@@ -102,9 +103,10 @@ b) MongoDB Group class implementation
102103

103104
.. code-block:: php
104105
105-
// src/MyProject/MyBundle/Document/Group.php
106+
<?php
107+
// src/AppBundle/Document/Group.php
106108
107-
namespace MyProject\MyBundle\Document;
109+
namespace AppBundle\Document;
108110
109111
use FOS\UserBundle\Document\Group as BaseGroup;
110112
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
@@ -125,9 +127,10 @@ c) CouchDB Group class implementation
125127

126128
.. code-block:: php
127129
128-
// src/MyProject/MyBundle/CouchDocument/Group.php
130+
<?php
131+
// src/AppBundle/CouchDocument/Group.php
129132
130-
namespace MyProject\MyBundle\CouchDocument;
133+
namespace AppBundle\CouchDocument;
131134
132135
use FOS\UserBundle\Document\Group as BaseGroup;
133136
use Doctrine\ODM\CouchDB\Mapping\Annotations as CouchDB;
@@ -155,9 +158,10 @@ a) ORM User-Group mapping
155158

156159
.. code-block:: php-annotations
157160
158-
// src/MyProject/MyBundle/Entity/User.php
161+
<?php
162+
// src/AppBundle/Entity/User.php
159163
160-
namespace MyProject\MyBundle\Entity;
164+
namespace AppBundle\Entity;
161165
162166
use FOS\UserBundle\Entity\User as BaseUser;
163167
use Doctrine\ORM\Mapping as ORM;
@@ -176,7 +180,7 @@ a) ORM User-Group mapping
176180
protected $id;
177181
178182
/**
179-
* @ORM\ManyToMany(targetEntity="MyProject\MyBundle\Entity\Group")
183+
* @ORM\ManyToMany(targetEntity="AppBundle\Entity\Group")
180184
* @ORM\JoinTable(name="fos_user_user_group",
181185
* joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
182186
* inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")}
@@ -237,9 +241,10 @@ b) MongoDB User-Group mapping
237241

238242
.. code-block:: php
239243
240-
// src/MyProject/MyBundle/Document/User.php
244+
<?php
245+
// src/AppBundle/Document/User.php
241246
242-
namespace MyProject\MyBundle\Document;
247+
namespace AppBundle\Document;
243248
244249
use FOS\UserBundle\Document\User as BaseUser;
245250
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
@@ -253,7 +258,7 @@ b) MongoDB User-Group mapping
253258
protected $id;
254259
255260
/**
256-
* @MongoDB\ReferenceMany(targetDocument="MyProject\MyBundle\Document\Group")
261+
* @MongoDB\ReferenceMany(targetDocument="AppBundle\Document\Group")
257262
*/
258263
protected $groups;
259264
}
@@ -263,9 +268,10 @@ c) CouchDB User-Group mapping
263268

264269
.. code-block:: php
265270
266-
// src/MyProject/MyBundle/CouchDocument/User.php
271+
<?php
272+
// src/AppBundle/CouchDocument/User.php
267273
268-
namespace MyProject\MyBundle\CouchDocument;
274+
namespace AppBundle\CouchDocument;
269275
270276
use FOS\UserBundle\Document\User as BaseUser;
271277
use Doctrine\ODM\CouchDB\Mapping\Annotations as CouchDB;
@@ -281,7 +287,7 @@ c) CouchDB User-Group mapping
281287
protected $id;
282288
283289
/**
284-
* @CouchDB\ReferenceMany(targetDocument="MyProject\MyBundle\CouchDocument\Group")
290+
* @CouchDB\ReferenceMany(targetDocument="AppBundle\CouchDocument\Group")
285291
*/
286292
protected $groups;
287293
}

Resources/doc/overriding_controllers.rst

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ bundle named ``AcmeUserBundle`` that declares itself a child of FOSUserBundle.
1212

1313
.. code-block:: php
1414
15+
<?php
1516
// src/Acme/UserBundle/AcmeUserBundle.php
1617
1718
namespace Acme\UserBundle;
@@ -42,6 +43,7 @@ the base controller and adds logging a new user registration to it.
4243

4344
.. code-block:: php
4445
46+
<?php
4547
// src/Acme/UserBundle/Controller/RegistrationController.php
4648
4749
namespace Acme\UserBundle\Controller;

Resources/doc/overriding_forms.rst

+3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ the form type hierarchy and then adds the custom ``name`` field.
6868

6969
.. code-block:: php
7070
71+
<?php
7172
// src/AppBundle/Form/RegistrationType.php
7273
7374
namespace AppBundle\Form;
@@ -173,6 +174,7 @@ protected ``onSuccess`` method.
173174

174175
.. code-block:: php
175176
177+
<?php
176178
// src/AppBundle/Form/Handler/RegistrationFormHandler.php
177179
178180
namespace AppBundle\Form\Handler;
@@ -206,6 +208,7 @@ successful submission.
206208

207209
.. code-block:: php
208210
211+
<?php
209212
// src/AppBundle/Form/Handler/RegistrationFormHandler.php
210213
211214
namespace AppBundle\Form\Handler;

Resources/doc/overriding_templates.rst

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class.
107107

108108
.. code-block:: php
109109
110+
<?php
110111
// src/Acme/UserBundle/AcmeUserBundle.php
111112
112113
namespace Acme\UserBundle;

0 commit comments

Comments
 (0)