NodeFactory

Create an element object depending on renderType.

This is the main factory to instantiate any node within the render chain of FormEngine. All nodes must implement NodeInterface.

Nodes are "container" classes of the render chain, "element" classes that render single elements, as well as "fieldWizard", "fieldInformation" and "fieldControl" classes which are called by single elements to enrich them.

This factory gets a string "renderType" and then looks up in a list which specific class should handle this renderType. This list can be extended with own renderTypes by extensions, existing renderTypes can be overridden, and

  • for complex cases - it is possible to register own resolver classes for single renderTypes that can return a node class name to override the default lookup list.
Tags
todo:

Declare final in v13. May require adding an interface to allow mocking in tests

Table of Contents

Methods

__construct()  : mixed
Set up factory. Initialize additionally registered nodes.
create()  : NodeInterface
Create a node depending on type

Methods

__construct()

Set up factory. Initialize additionally registered nodes.

public __construct() : mixed

create()

Create a node depending on type

public create(array<string|int, mixed> $data) : NodeInterface
Parameters
$data : array<string|int, mixed>

All information to decide which class should be instantiated and given down to sub nodes

Tags
throws
Exception
Return values
NodeInterface

        
On this page

Search results