/**
  * @param \Sonata\AdminBundle\Form\FormMapper $formMapper
  * @return void
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     if (!$this->isChild()) {
         $formMapper->add('post', 'sonata_type_model', array(), array('edit' => 'list'));
         //            $formMapper->add('post', 'sonata_type_admin', array(), array('edit' => 'inline'));
     }
     $formMapper->add('name')->add('email')->add('url', null, array('required' => false))->add('message')->add('status', 'choice', array('choices' => Comment::getStatusList(), 'expanded' => true, 'multiple' => false));
 }
Exemplo n.º 2
0
 /**
  * @param \Sonata\AdminBundle\Form\FormMapper $formMapper
  *
  * @return void
  */
 protected function configureFormFields(FormMapper $formMapper)
 {
     $formMapper->with('General')->add('enabled', null, array('required' => false))->add('author', 'sonata_type_model', array(), array('edit' => 'list'))->add('category', 'sonata_type_model', array(), array('edit' => 'list'))->add('title')->add('abstract')->add('contentFormatter', 'sonata_formatter_type_selector', array('source' => 'rawContent', 'target' => 'content'))->add('rawContent')->end()->with('Tags')->add('tags', 'sonata_type_model', array('expanded' => true))->end()->with('Options')->add('publicationDateStart')->add('commentsCloseAt')->add('commentsEnabled', null, array('required' => false))->add('commentsDefaultStatus', 'choice', array('choices' => Comment::getStatusList(), 'expanded' => true))->end();
 }