]> Raphaƫl G. Git Repositories - blogbundle/blobdiff - Form/AuthorType.php
Add form files
[blogbundle] / Form / AuthorType.php
diff --git a/Form/AuthorType.php b/Form/AuthorType.php
new file mode 100644 (file)
index 0000000..9a908a4
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+
+namespace Rapsys\BlogBundle\Form;
+
+use Symfony\Component\Form\AbstractType;
+use Symfony\Component\Form\FormBuilderInterface;
+use Symfony\Component\OptionsResolver\OptionsResolver;
+
+class AuthorType extends AbstractType
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function buildForm(FormBuilderInterface $builder, array $options)
+    {
+        $builder->add('name')->add('slug')->add('created')->add('updated');
+    }
+    
+    /**
+     * {@inheritdoc}
+     */
+    public function configureOptions(OptionsResolver $resolver)
+    {
+        $resolver->setDefaults(array(
+            'data_class' => 'Rapsys\BlogBundle\Entity\Author'
+        ));
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getBlockPrefix()
+    {
+        return 'rapsys_blogbundle_author';
+    }
+}