From e42311892947dc0fb89ace6f0fe7c8a7e07a766e Mon Sep 17 00:00:00 2001 From: Abdellatif AitBoudad Date: Sat, 26 Apr 2014 22:35:45 +0100 Subject: [PATCH 1/6] [Form customization] added block_name example. --- cookbook/form/form_customization.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cookbook/form/form_customization.rst b/cookbook/form/form_customization.rst index 554816a1f67..c0e75056b41 100644 --- a/cookbook/form/form_customization.rst +++ b/cookbook/form/form_customization.rst @@ -660,6 +660,25 @@ field whose *id* is ``product_name`` (and name is ``product[name]``). ``ProductType`` equates to ``product``). If you're not sure what your form name is, just view the source of your generated form. + If you want to change the ``product`` or ``name`` portion of the block + name ``_product_name_widget`` you can set the ``block_name`` option in your + form type: + + .. code-block:: php + + use Symfony\Component\Form\FormBuilderInterface; + + public function buildForm(FormBuilderInterface $builder, array $options) + { + // ... + + $builder->add('name', 'text', array( + 'block_name' => 'custom_name' + )); + } + + The block name can then be ``_product_custom_name_widget`` + You can also override the markup for an entire field row using the same method: .. configuration-block:: From 512d5eb25c7df9e454b20da5124434b22d4f8949 Mon Sep 17 00:00:00 2001 From: Abdellatif AitBoudad Date: Sun, 27 Apr 2014 11:54:07 +0100 Subject: [PATCH 2/6] [Form customization] fixed minor typos --- cookbook/form/form_customization.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cookbook/form/form_customization.rst b/cookbook/form/form_customization.rst index c0e75056b41..9ff6975369d 100644 --- a/cookbook/form/form_customization.rst +++ b/cookbook/form/form_customization.rst @@ -662,9 +662,7 @@ field whose *id* is ``product_name`` (and name is ``product[name]``). If you want to change the ``product`` or ``name`` portion of the block name ``_product_name_widget`` you can set the ``block_name`` option in your - form type: - - .. code-block:: php + form type:: use Symfony\Component\Form\FormBuilderInterface; @@ -673,11 +671,11 @@ field whose *id* is ``product_name`` (and name is ``product[name]``). // ... $builder->add('name', 'text', array( - 'block_name' => 'custom_name' + 'block_name' => 'custom_name', )); } - The block name can then be ``_product_custom_name_widget`` + Then the block name will be ``_product_custom_name_widget``. You can also override the markup for an entire field row using the same method: From 181e3fa41d617521f5007de56e8903250871c3ed Mon Sep 17 00:00:00 2001 From: Abdellatif AitBoudad Date: Sat, 10 May 2014 19:39:44 +0100 Subject: [PATCH 3/6] [Routing][Loader] added JMSI18nRoutingBundle --- cookbook/routing/custom_route_loader.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbook/routing/custom_route_loader.rst b/cookbook/routing/custom_route_loader.rst index 36694e36727..5c582db6230 100644 --- a/cookbook/routing/custom_route_loader.rst +++ b/cookbook/routing/custom_route_loader.rst @@ -20,7 +20,7 @@ off the names of the action methods in a controller. There are many bundles out there that use their own route loaders to accomplish cases like those described above, for instance - `FOSRestBundle`_, `KnpRadBundle`_ and `SonataAdminBundle`_. + `FOSRestBundle`_, `JMSI18nRoutingBundle`_, `KnpRadBundle`_ and `SonataAdminBundle`_. Loading Routes -------------- @@ -262,5 +262,6 @@ configuration file - you can call the loader (YAML, XML, PHP, annotation, etc.). .. _`FOSRestBundle`: https://github.com/FriendsOfSymfony/FOSRestBundle +.. _`JMSI18nRoutingBundle`: https://github.com/schmittjoh/JMSI18nRoutingBundle .. _`KnpRadBundle`: https://github.com/KnpLabs/KnpRadBundle .. _`SonataAdminBundle`: https://github.com/sonata-project/SonataAdminBundle From 517d54e6649eb5e8026f1dd1f70e283c780223d3 Mon Sep 17 00:00:00 2001 From: Abdellatif AitBoudad Date: Sat, 10 May 2014 18:28:22 +0100 Subject: [PATCH 4/6] added link to /cookbook/security/force_https. --- cookbook/routing/scheme.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbook/routing/scheme.rst b/cookbook/routing/scheme.rst index 723c18f9b09..a9727560398 100644 --- a/cookbook/routing/scheme.rst +++ b/cookbook/routing/scheme.rst @@ -69,4 +69,5 @@ to always use ``http``. The Security component provides another way to enforce HTTP or HTTPS via the ``requires_channel`` setting. This alternative method is better suited to secure an "area" of your website (all URLs under ``/admin``) or when - you want to secure URLs defined in a third party bundle. + you want to secure URLs defined in a third party bundle (see + :doc:`/cookbook/security/force_https` for more details). From d5cd9e880b3cbec08f2ed8e2b2972a60c4b14228 Mon Sep 17 00:00:00 2001 From: Reinis Grinbergs Date: Thu, 15 May 2014 10:23:11 +0200 Subject: [PATCH 5/6] Fixed link and typo in type_guesser.rst --- components/form/type_guesser.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/form/type_guesser.rst b/components/form/type_guesser.rst index 015bb8aeb1b..819e835ca8e 100644 --- a/components/form/type_guesser.rst +++ b/components/form/type_guesser.rst @@ -79,7 +79,7 @@ The ``TypeGuess`` constructor requires 3 options: want to set the ``class`` option). If no types are guessed, this should be set to an empty array; * The confidence that the guessed type is correct. This can be one of the - constants of the :class:`Symfony\\Component\\Form\\Guess\Guess` class: + constants of the :class:`Symfony\\Component\\Form\\Guess\\Guess` class: ``LOW_CONFIDENCE``, ``MEDIUM_CONFIDENCE``, ``HIGH_CONFIDENCE``, ``VERY_HIGH_CONFIDENCE``. After all type guessers have been executed, the type with the highest confidence is used. @@ -105,7 +105,7 @@ With this knowledge, you can easily implement the ``guessType`` method of the // otherwise, base the type on the @var annotation switch ($annotations['var']) { case 'string': - // there is a high confidence that the type is a string when + // there is a high confidence that the type is text when // @var string is used return new TypeGuess('text', array(), Guess::HIGH_CONFIDENCE); From 918e9c275a79c768bc704a9c860a7718e6b73d6c Mon Sep 17 00:00:00 2001 From: Trent Steel Date: Mon, 5 May 2014 20:45:15 +1000 Subject: [PATCH 6/6] Generate an APC prefix based on __FILE__ Relates to https://github.com/symfony/symfony-standard/issues/654 --- components/class_loader/cache_class_loader.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/class_loader/cache_class_loader.rst b/components/class_loader/cache_class_loader.rst index e31a418b04b..cb2dc5f93c8 100644 --- a/components/class_loader/cache_class_loader.rst +++ b/components/class_loader/cache_class_loader.rst @@ -37,8 +37,8 @@ ApcClassLoader // instance of a class that implements a findFile() method, like the ClassLoader $loader = ...; - // my_prefix is the APC namespace prefix to use - $cachedLoader = new ApcClassLoader('my_prefix', $loader); + // sha1(__FILE__) generates an APC namespace prefix + $cachedLoader = new ApcClassLoader(sha1(__FILE__), $loader); // register the cached class loader $cachedLoader->register(); @@ -60,8 +60,8 @@ it is straightforward:: // instance of a class that implements a findFile() method, like the ClassLoader $loader = ...; - // my_prefix is the XCache namespace - $cachedLoader = new XcacheClassLoader('my_prefix', $loader); + // sha1(__FILE__) generates an XCache namespace prefix + $cachedLoader = new XcacheClassLoader(sha1(__FILE__), $loader); // register the cached class loader $cachedLoader->register();