This repository was archived by the owner on Sep 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,8 @@ object and all the ``Posts`` to the view::
71
71
*/
72
72
public function pageAction($contentDocument)
73
73
{
74
- $dm = $this->get('doctrine_phpcr')->getManager( );
75
- $posts = $dm->getRepository('Acme\BasicCmsBundle\Document\ Post')->findAll();
74
+ $dm = $this->get('doctrine_phpcr')->getManagerForClass('AcmeBasicCmsBundle:Post' );
75
+ $posts = $dm->getRepository('AcmeBasicCmsBundle: Post')->findAll();
76
76
77
77
return array(
78
78
'page' => $contentDocument,
@@ -125,3 +125,12 @@ router and because it implements the ``RouteReferrersReadInterface`` the
125
125
126
126
Click on a ``Post `` and you will have the same error that you had before when
127
127
viewing the page at ``/home `` and you can resolve it in the same way.
128
+
129
+ .. tip ::
130
+
131
+ If you have different content classes with different templates, but you
132
+ don't need specific controller logic, you can configure
133
+ ``templates_by_class `` instead of ``controllers_by_class `` to let the
134
+ default controller render a specific template. See
135
+ :ref: `bundles-routing-dynamic_router-enhancer ` for more information on
136
+ this.
You can’t perform that action at this time.
0 commit comments