Skip to content

Instantly share code, notes, and snippets.

@tatma
Last active November 27, 2018 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tatma/a58c2df061af7b17b0e8bb5974f2bba5 to your computer and use it in GitHub Desktop.
Save tatma/a58c2df061af7b17b0e8bb5974f2bba5 to your computer and use it in GitHub Desktop.
Type di Article
<?php
namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
class ArticleType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('title', TextType::class, ['required' => true])
->add('content', TextareaType::class, ['required' => true])
->getForm();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment