Source of file FormFactory.php
Size: 0,995 Bytes - Last Modified: 2021-12-23T10:32:46+00:00
/var/www/docs.ssmods.com/process/src/src/Form/FormFactory.php
123456789101112131415161718192021222324252627282930313233343536 | <?php namespace SilverStripe\Link\Form; use LogicException; use SilverStripe\Admin\Forms\LinkFormFactory; use SilverStripe\Forms\HiddenField; use SilverStripe\Link\Type\Type; /** * Create Form schema for the LinkField based on a key provided by the request. */ class FormFactory extends LinkFormFactory { protected function getFormFields($controller, $name, $context) { /** @var Type $type */ $type = $context['LinkType']; if (empty($type) || !$type instanceof Type) { throw new LogicException(sprintf('%s: LinkType must be provided and must be an instance of Type', __CLASS__)); } $fields = $type->scaffoldLinkFields([]); $fields->push(HiddenField::create('typeKey')->setValue($context['LinkTypeKey'])); $this->extend('updateFormFields', $fields, $controller, $name, $context); return $fields; } protected function getValidator($controller, $name, $context) { return null; } } |