Ok it is probably something simple but i just cant find where the problem is. I have tried with but no match for my problem
I am trying to create from but from form class, not create form in controller..
here is the code..
this is from controller
/**
* @Route("login", name="login")
*/
public function loginAction (Request $request) {
$registration = new Registration();
$form = $this->createForm(LoginForm::class, $registration, array(
'method' => 'POST'
));
return $this->render(
'admin/login.html.twig',
array('form' => $form->createView())
);
}
Inside controller i used USE to defind LoginForm i use in part createForm, so that is not problem
this is from FORM class
<?php
namespace AppBundle\AppForm;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
class LoginForm extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name')
->add('password')
->add('save', SubmitType::class);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
array(
'data_class' => 'AppBundle\Entity\Registration'
));
}
public function getName()
{
}
}