Cleaning + refactoring
This commit is contained in:
parent
e1674659a7
commit
8b3d43beb3
|
@ -3,7 +3,6 @@
|
|||
namespace AppBundle\Controller;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Trinity\Bundle\ContentManagerBundle\Controller\PageController;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
@ -22,10 +21,10 @@ class CategoryController extends Controller
|
|||
*
|
||||
* @Template()
|
||||
* @Route("/", name="example")
|
||||
*
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return \Symfony\Bundle\FrameworkBundle\Controller\Response
|
||||
* @return array
|
||||
*/
|
||||
public function indexAction(Request $request)
|
||||
{
|
||||
|
|
|
@ -7,6 +7,7 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use AppBundle\Entity\Category;
|
||||
|
||||
class CategoryType extends AbstractType
|
||||
{
|
||||
|
@ -34,7 +35,7 @@ class CategoryType extends AbstractType
|
|||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => 'AppBundle\Entity\Category',
|
||||
'data_class' => Category::class,
|
||||
'csrf_protection' => false,
|
||||
'allow_extra_fields' => true,
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue