예제 #1
0
 /**
  * @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $adminManager = $this->adminManager;
     $adminNormalizer = function (Options $options, $admin) use($adminManager) {
         if (!$admin instanceof ContentAdmin) {
             //TODO: deprecated notice ?
             $admin = $adminManager->getAdmin($admin);
         }
         return $admin;
     };
     $resolver->setDefaults(array('params' => array('id' => 'id'), 'modal' => false))->setDefined(array('icon'))->setRequired(array('admin', 'action'))->setAllowedTypes('params', 'array')->setAllowedTypes('admin', array('string', 'Leapt\\AdminBundle\\Admin\\ContentAdmin'))->setAllowedTypes('action', 'string')->setNormalizer('admin', $adminNormalizer);
 }
예제 #2
0
 /**
  * @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefaults(array('params' => array()))->setRequired(array('route'));
 }