From 9c36282a50771dd76d11fd0dcb91e5d250b8a6b7 Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Fri, 1 Apr 2016 11:10:44 +0200 Subject: [PATCH] better explain the form type --- bundles/seo/seo_aware.rst | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/bundles/seo/seo_aware.rst b/bundles/seo/seo_aware.rst index 512ba2d0..866e22a2 100644 --- a/bundles/seo/seo_aware.rst +++ b/bundles/seo/seo_aware.rst @@ -23,7 +23,7 @@ the ``SeoMetadata``:: { return $this->seoMetadata; } - + public function setSeoMetadata($metadata) { $this->seoMetadata = $metadata; @@ -240,14 +240,30 @@ the ``SeoMetadata`` entity. Form Type --------- -The bundle also provides a special form type called ``seo_metadata``. This -form type can be used in forms to edit the ``SeoMetadata`` object. +The bundle also provides a special form type called ``Symfony\Cmf\Bundle\SeoBundle\Form\Type\SeoMetadataType`` +(use ``seo_metadata`` for Symfony versions older than 2.8). This form type can be +used in forms to edit the ``SeoMetadata`` object:: + + use Sonata\AdminBundle\Form\FormMapper; + use Symfony\Cmf\Bundle\SeoBundle\Form\Type\SeoMetadataType; + + /** @var FormMapper $formMapper */ + $formMapper + ->add('seoMetadata', SeoMetadataType::class) + ; .. caution:: The form type requires the `BurgovKeyValueFormBundle`_ to be installed and registered. +.. note:: + + If you use Doctrine ORM, you need the form option ``by_reference`` set to + ``false``. If you enabled the ORM backend but not the PHPCR backend, this + option is set by default, otherwise you need to explicitly specify it in + your ORM forms. + Sonata Admin Integration ------------------------