Browse Source

fix error "There must be a representation field specified"

inmarelibero 13 years ago
parent
commit
e82b8f7ec9
1 changed files with 7 additions and 1 deletions
  1. 7 1
      doc/tree.md

+ 7 - 1
doc/tree.md

@@ -536,7 +536,11 @@ $repo = $em->getRepository('Entity\Category');
 $htmlTree = $repo->childrenHierarchy(
     null, /* starting from root nodes */
     false, /* load all children, not only direct */
-    array('decorate' => true)
+    true, /* render html */
+    array(
+        'decorate' => true,
+        'representationField' => 'slug'
+    )
 );
 ```
 
@@ -547,6 +551,7 @@ $htmlTree = $repo->childrenHierarchy(
 $repo = $em->getRepository('Entity\Category');
 $options = array(
     'decorate' => true,
+    'representationField' => 'slug',
     'rootOpen' => '<ul>',
     'rootClose' => '</ul>',
     'childOpen' => '<li>',
@@ -558,6 +563,7 @@ $options = array(
 $htmlTree = $repo->childrenHierarchy(
     null, /* starting from root nodes */
     false, /* load all children, not only direct */
+    true, /* render html */
     $options
 );
 ```