public function init() { parent::init(); $this->remove('subscriberId')->remove('dateCreated')->remove('name')->remove('subscribe'); $this->add(['name' => 'captcha', 'type' => 'UthandoCommonCaptcha', 'attributes' => ['placeholder' => 'Type letters and number here'], 'options' => ['label' => 'Please verify you are human.', 'twb-layout' => TwbBundleForm::LAYOUT_HORIZONTAL, 'column-size' => 'sm-10 col-sm-offset-2', 'label_attributes' => ['class' => 'col-sm-10 col-sm-offset-2']]]); $this->add(['name' => 'submit', 'type' => 'submit', 'options' => ['label' => 'Remove Email', 'twb-layout' => TwbBundleForm::LAYOUT_HORIZONTAL, 'column-size' => 'sm-10 col-sm-offset-2']]); $this->add(['name' => 'security', 'type' => 'csrf']); }
public function init() { parent::init(); $this->get('name')->setAttribute('readonly', true); $this->get('email')->setAttribute('readonly', true); $this->get('subscribe')->setIncludeHidden(false); $this->add(['name' => 'submit', 'type' => 'submit', 'options' => ['label' => 'Update', 'twb-layout' => TwbBundleForm::LAYOUT_HORIZONTAL, 'column-size' => 'sm-10 col-sm-offset-2']]); }
public function testCanUseNameAsOptions() { $form = new Subscriber(['name' => 'subscriber']); $this->assertSame('subscriber', $form->getName()); }