/** * Create form. * * @param AbstractModel $entity Entity object. */ public function __construct(AbstractModel $entity = null) { parent::__construct($entity); $this->setValue('checked', 1); }
/** * Create translation action. * * @return void * * @Route("/create-item", methods={"GET", "POST"}, name="admin-languages-create-item") */ public function createItemAction() { $form = new CreateItem(); $this->view->form = $form; $data = ['language_id' => $this->request->get('language_id')]; $form->setValues($data); if (!$this->request->isPost() || !$form->isValid()) { return; } $this->resolveModal(); }