Bundle/BlogBundle/Form/HierarchyTreeType.php
public function buildView(FormView $view, FormInterface $form, array $options)
    {
        foreach ($view->vars['choices'] as $choice) {
            $dataNode = $choice->data;
            $level = $this->propertyAccessor->getValue($dataNode, 'lvl');

            $choice->label = str_repeat(str_repeat('&#160;', $level), 4).$choice->label;
        }
    }
public function buildView(FormView $view, FormInterface $form, array $options)
    {
        foreach ($view->vars['choices'] as $choice) {
            $dataNode = $choice->data;
            $level = $this->propertyAccessor->getValue($dataNode, 'lvl');

            $choice->label = str_repeat(str_repeat('&#160;', $level), 4).$choice->label;
        }
    }
public function buildView ( FormView $ view , FormInterface $ form , array $ options ) { foreach ( $ view -> vars [ 'choices' ] as $ choice ) { $ dataNode = $ choice -> data ; $ level = $ this -> propertyAccessor -> getValue ( $ dataNode , 'lvl' ) ; $ choice -> label = str_repeat ( str_repeat ( '&#160;' , $ level ) , 4 ) . $ choice -> label ; } }
genere le formulaire.

@param \Symfony\Component\Form\FormView      $view
@param \Symfony\Component\Form\FormInterface $form
@param array                                 $options
genere le formulaire .