Skip to content

Commit

Permalink
Merge pull request #661 from creative-commoners/pulls/1.3/factory-ext…
Browse files Browse the repository at this point in the history
…ensibility

NEW Add update extension hooks for LinkFormFactory subclasses
  • Loading branch information
ScopeyNZ authored Nov 10, 2018
2 parents 58fab47 + 4415655 commit 63d11f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/Forms/EditorEmailLinkFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ protected function getFormFields($controller, $name, $context)
$fields->insertAfter('Link', TextField::create('Text', _t(__CLASS__.'.LINKTEXT', 'Link text')));
}

$this->extend('updateFormFields', $fields, $controller, $name, $context);

return $fields;
}

Expand Down
4 changes: 4 additions & 0 deletions code/Forms/LinkFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public function getForm(RequestHandler $controller = null, $name = FormFactory::
$form = Form::create($controller, $name, $fields, $actions, $validator);
$form->addExtraClass('form--no-dividers');

$this->extend('updateForm', $form, $controller, $name, $context);

return $form;
}

Expand All @@ -55,6 +57,8 @@ protected function getFormActions($controller, $name, $context)
->setSchemaData(['data' => ['buttonStyle' => 'primary']]),
]);

$this->extend('updateFormActions', $actions, $controller, $name, $context);

return $actions;
}

Expand Down

0 comments on commit 63d11f7

Please sign in to comment.