public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('user', 'user', array('label' => 'User ID', 'required' => false)); $builder->add('ip', 'text', array('label' => 'IP', 'required' => false)); $builder->add('howLong', 'choice', array('label' => 'On how long', 'choices' => Ban::howLongChoices())); $builder->add('reason', 'textarea', array('label' => 'Reason', 'required' => false)); }
/** * @Route("", name="moderator_bans") */ public function bans() { $bans = Ban::findAll(); return $this->render('moderator/ban/index.twig', array('bans' => $bans, 'howLongChoices' => Ban::howLongChoices())); }