File tree Expand file tree Collapse file tree 5 files changed +27
-8
lines changed
Filter options
Expand file tree Collapse file tree 5 files changed +27
-8
lines changed
Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ ApcClassLoader
34
34
// instance of a class that implements a findFile() method, like the ClassLoader
35
35
$loader = ...;
36
36
37
- // my_prefix is the APC namespace prefix to use
38
- $cachedLoader = new ApcClassLoader('my_prefix' , $loader);
37
+ // sha1(__FILE__) generates an APC namespace prefix
38
+ $cachedLoader = new ApcClassLoader(sha1(__FILE__) , $loader);
39
39
40
40
// register the cached class loader
41
41
$cachedLoader->register();
@@ -54,8 +54,8 @@ it is straightforward::
54
54
// instance of a class that implements a findFile() method, like the ClassLoader
55
55
$loader = ...;
56
56
57
- // my_prefix is the XCache namespace
58
- $cachedLoader = new XcacheClassLoader('my_prefix' , $loader);
57
+ // sha1(__FILE__) generates an XCache namespace prefix
58
+ $cachedLoader = new XcacheClassLoader(sha1(__FILE__) , $loader);
59
59
60
60
// register the cached class loader
61
61
$cachedLoader->register();
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ The ``TypeGuess`` constructor requires 3 options:
79
79
want to set the ``class `` option). If no types are guessed, this should be
80
80
set to an empty array;
81
81
* The confidence that the guessed type is correct. This can be one of the
82
- constants of the :class: `Symfony\\ Component\\ Form\\ Guess\G uess ` class:
82
+ constants of the :class: `Symfony\\ Component\\ Form\\ Guess\\ Guess ` class:
83
83
``LOW_CONFIDENCE ``, ``MEDIUM_CONFIDENCE ``, ``HIGH_CONFIDENCE ``,
84
84
``VERY_HIGH_CONFIDENCE ``. After all type guessers have been executed, the
85
85
type with the highest confidence is used.
@@ -105,7 +105,7 @@ With this knowledge, you can easily implement the ``guessType`` method of the
105
105
// otherwise, base the type on the @var annotation
106
106
switch ($annotations['var']) {
107
107
case 'string':
108
- // there is a high confidence that the type is a string when
108
+ // there is a high confidence that the type is text when
109
109
// @var string is used
110
110
return new TypeGuess('text', array(), Guess::HIGH_CONFIDENCE);
111
111
Original file line number Diff line number Diff line change @@ -660,6 +660,23 @@ field whose *id* is ``product_name`` (and name is ``product[name]``).
660
660
``ProductType `` equates to ``product ``). If you're not sure what your
661
661
form name is, just view the source of your generated form.
662
662
663
+ If you want to change the ``product `` or ``name `` portion of the block
664
+ name ``_product_name_widget `` you can set the ``block_name `` option in your
665
+ form type::
666
+
667
+ use Symfony\Component\Form\FormBuilderInterface;
668
+
669
+ public function buildForm(FormBuilderInterface $builder, array $options)
670
+ {
671
+ // ...
672
+
673
+ $builder->add('name', 'text', array(
674
+ 'block_name' => 'custom_name',
675
+ ));
676
+ }
677
+
678
+ Then the block name will be ``_product_custom_name_widget ``.
679
+
663
680
You can also override the markup for an entire field row using the same method:
664
681
665
682
.. configuration-block ::
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ off the names of the action methods in a controller.
20
20
21
21
There are many bundles out there that use their own route loaders to
22
22
accomplish cases like those described above, for instance
23
- `FOSRestBundle `_, `KnpRadBundle `_ and `SonataAdminBundle `_.
23
+ `FOSRestBundle `_, `JMSI18nRoutingBundle `_, ` KnpRadBundle `_ and `SonataAdminBundle `_.
24
24
25
25
Loading Routes
26
26
--------------
@@ -262,5 +262,6 @@ configuration file - you can call the
262
262
loader (YAML, XML, PHP, annotation, etc.).
263
263
264
264
.. _`FOSRestBundle` : https://github.com/FriendsOfSymfony/FOSRestBundle
265
+ .. _`JMSI18nRoutingBundle` : https://github.com/schmittjoh/JMSI18nRoutingBundle
265
266
.. _`KnpRadBundle` : https://github.com/KnpLabs/KnpRadBundle
266
267
.. _`SonataAdminBundle` : https://github.com/sonata-project/SonataAdminBundle
Original file line number Diff line number Diff line change @@ -69,4 +69,5 @@ to always use ``http``.
69
69
The Security component provides another way to enforce HTTP or HTTPS via
70
70
the ``requires_channel `` setting. This alternative method is better suited
71
71
to secure an "area" of your website (all URLs under ``/admin ``) or when
72
- you want to secure URLs defined in a third party bundle.
72
+ you want to secure URLs defined in a third party bundle (see
73
+ :doc: `/cookbook/security/force_https ` for more details).
You can’t perform that action at this time.
0 commit comments