cmf menu-bunlde safe labels

10 views
Skip to first unread message

Frank Beentjes

unread,
Oct 18, 2016, 4:16:36 PM10/18/16
to symfony-cmf-devs
{{ knp_menu_render('main-menu', {'allow_safe_labels': true}) }}

LoadRoutingData.php:
                $phpcrMenuitem = new MenuNode();
                $phpcrMenuitem
->setName($menuitem['homepage');
                $phpcrMenuitem
->setParentDocument($phpcrMenu);
                $phpcrMenuitem
->setRoute('homepage');
                $phpcrMenuitem
->setLabel('<i class="fa fa-home"></i> Home');
                $phpcrMenuitem
->setExtras(array('safe_label' => true));
                $documentManager
->persist($phpcrMenuitem);


bin/console doctrine:phpcr:node:dump /cms/menu --props
/cms/menu:
 
- jcr:primaryType = nt:unstructured
  main
-menu:
   
- jcr:primaryType = nt:unstructured
   
- jcr:mixinTypes = Array(    [0] => phpcr:managed    [1] => mix:referenceable)
   
- phpcr:class = Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\Menu
   
- phpcr:classparents = Array(    [0] => Symfony\Cmf\Bundle\MenuBundle\Model\MenuNodeBase    [1] => Symfony\Cmf\Bundle\MenuBundle\Model\MenuN...
   
- jcr:uuid = 4619ac7c-c2bb-431c-9246-80fb74c36ba3
   
- label = main-menu
   
- routeAbsolute =
   
- display = 1
   
- displayChildren = 1
   
- attributes = Array()
   
- childrenAttributesKeys = Array(    [0] => class)
   
- childrenAttributesNulls = Array()
   
- childrenAttributes = Array(    [0] => nav navbar-nav navbar-right)
   
- extras = Array()
   
- routeParameters = Array()
   
- linkAttributes = Array()
   
- labelAttributes = Array()
   
- publishable = 1
    homepage
:
     
- jcr:primaryType = nt:unstructured
     
- jcr:mixinTypes = Array(    [0] => phpcr:managed    [1] => mix:referenceable)
     
- phpcr:class = Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode
     
- phpcr:classparents = Array(    [0] => Symfony\Cmf\Bundle\MenuBundle\Model\MenuNodeBase    [1] => Symfony\Cmf\Bundle\MenuBundle\Model\MenuN...
     
- jcr:uuid = 9fd3dd83-5f05-4aa9-a7f1-dc2c5ced810e
     
- label = <i class="fa fa-home"></i> Home
     
- route = homepage
     
- routeAbsolute =
     
- display = 1
     
- displayChildren = 1
     
- attributes = Array()
     
- childrenAttributes = Array()
     
- extrasKeys = Array(    [0] => safe_label)
     
- extrasNulls = Array()
     
- extras = Array(    [0] => 1)
     
- routeParameters = Array()
     
- linkAttributes = Array()
     
- labelAttributes = Array()
     
- publishable = 1


I can't find what i am doing wrong. Labels are not escaped. Has somebody any idea?

Reply all
Reply to author
Forward
0 new messages