Newscoop\NewscoopBundle\Form\Type\ArticleImageType::buildForm PHP Метод

buildForm() публичный Метод

public buildForm ( Symfony\Component\Form\FormBuilderInterface $builder, array $options )
$builder Symfony\Component\Form\FormBuilderInterface
$options array
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('number', 'number', array('label' => 'articles.images.edit.form.number', 'trim' => true, 'error_bubbling' => true));
        if ($options['rich_text_caption'] == 'Y') {
            $builder->add('caption', 'textarea', array('label' => 'articles.images.edit.form.caption', 'error_bubbling' => true));
        } else {
            $builder->add('caption', 'text', array('label' => 'articles.images.edit.form.caption', 'error_bubbling' => true));
        }
        $builder->add('language', 'hidden', array('error_bubbling' => true));
        $builder->add('status', 'choice', array('choices' => array('Y' => 'articles.images.edit.form.status_approved', 'N' => 'articles.images.edit.form.status_unapproved'), 'error_bubbling' => true, 'multiple' => false, 'expanded' => false, 'required' => true, 'label' => 'articles.images.edit.form.status'));
        if ($options['rich_text_caption'] == 'Y') {
            $builder->add('description', 'textarea', array('label' => 'articles.images.edit.form.description', 'error_bubbling' => true));
        } else {
            $builder->add('description', 'text', array('label' => 'articles.images.edit.form.description', 'error_bubbling' => true));
        }
        $builder->add('photographer', 'text', array('label' => 'articles.images.edit.form.photographer', 'error_bubbling' => true));
        $builder->add('photographer_url', 'text', array('label' => 'articles.images.edit.form.photographer_url', 'error_bubbling' => true));
        $builder->add('place', 'text', array('label' => 'articles.images.edit.form.place', 'error_bubbling' => true));
        $builder->add('date', 'text', array('label' => 'articles.images.edit.form.date', 'error_bubbling' => true, 'attr' => array('placeholder' => date('Y-m-d'))));
    }