abstract class AbstractGenerator (View source)

Common base class for XML generators.

Properties

protected ClassReflection $abstractViewHelperReflectionClass

The reflection class for AbstractViewHelper. Is needed quite often, that's why we use a pre-initialized one.

protected DocCommentParser $docCommentParser

The doc comment parser.

protected ReflectionService $reflectionService

Methods

__construct()

Constructor. Sets $this->abstractViewHelperReflectionClass

array
getClassNamesInNamespace(string $namespace)

Get all class names inside this namespace and return them as array.

string
getTagNameForClass(string $className, string $namespace)

Get a tag name for a given ViewHelper class.

addChildWithCData(SimpleXMLElement $parentXmlNode, string $childNodeName, string $childNodeValue)

Add a child node to $parentXmlNode, and wrap the contents inside a CDATA section.

Details

__construct()

Constructor. Sets $this->abstractViewHelperReflectionClass

protected array getClassNamesInNamespace(string $namespace)

Get all class names inside this namespace and return them as array.

Parameters

string $namespace

Return Value

array

Array of all class names inside a given namespace.

protected string getTagNameForClass(string $className, string $namespace)

Get a tag name for a given ViewHelper class.

Example: For the View Helper Neos\FluidAdaptor\ViewHelpers\Form\SelectViewHelper, and the namespace prefix Neos\FluidAdaptor\ViewHelpers\, this method returns "form.select".

Parameters

string $className

Class name

string $namespace

Base namespace to use

Return Value

string

Tag name

protected SimpleXMLElement addChildWithCData(SimpleXMLElement $parentXmlNode, string $childNodeName, string $childNodeValue)

Add a child node to $parentXmlNode, and wrap the contents inside a CDATA section.

Parameters

SimpleXMLElement $parentXmlNode

Parent XML Node to add the child to

string $childNodeName

Name of the child node

string $childNodeValue

Value of the child node. Will be placed inside CDATA.

Return Value

SimpleXMLElement

the new element