/** * execute */ public function doDefault() { if (!$this->form->isSubmitted()) { // Load consumer values $this->form->setFieldValue('name', $this->consumer->name); $this->form->setFieldValue('key', $this->consumer->getKey()); $this->form->setFieldValue('secret', $this->consumer->secret); $this->form->setFieldValue('css_path', $this->consumer->css_path); $this->form->setFieldValue('enabled', $this->consumer->enabled); //$this->form->setFieldValue('protected', $this->consumer->protected); } }
public function testSubmitSimpleForm() { $form = new Form('product'); $form->submit(['foo' => 'bar'], ['tmp' => '/foo.png']); $this->assertSame('product', $form->getName()); $this->assertNull($form->getParent()); $this->assertSame(['foo' => 'bar'], $form->getData()); $this->assertSame(['tmp' => '/foo.png'], $form->getFiles()); $this->assertTrue($form->isRoot()); $this->assertTrue($form->isSubmitted()); }
/** * doDefault */ public function doDefault() { if (!$this->form->isSubmitted()) { $this->form->setFieldValue('coa-course-enable', explode(',', $this->form->getFieldValue('coa-course-enable'))); } }
/** * doDefault */ public function doDefault() { if (!$this->form->isSubmitted()) { $this->form->setFieldValue('system-maintenance-access-permission', explode(',', $this->getConfig()->get('system.maintenance.access.permission'))); } }