This feature is a re-implementation of the XSD schema generator, which was previously
available as a separate package ^1. These schema files provide auto-complete in IDEs
(like PHPStorm) for all available ViewHelpers in a composer project.
The bin/fluid CLI command now supports the additional command schema, which scans
the whole composer projects for valid ViewHelper classes. The class in question needs
to meet the following requirements, which enforces already-existing conventions:
file name must end with ViewHelper.php
file path must contain a directory ViewHelpers, which serves as a divider between
a Fluid namespace and its ViewHelpers
class must implement ViewHelperInterface
class name must end with ViewHelper
class must not be abstract
These conditions are checked by ViewHelperMetadataFactory, which then creates the
corresponding ViewHelperMetadata value object. The SchemaGenerator then receives
a list of ViewHelperMetadata objects as well as an XML namespace (like
http://typo3.org/ns/TYPO3Fluid/Fluid/ViewHelpers) and generates an xsd schema file
that describes the ViewHelper and its arguments. The ConsoleRunner collects these files, creates unique file names and writes them as schema_*.xsd files to the destination
folder, specified with --destination.
IDEs either pick up those files automatically or need to be configured manually to
do so.
This feature is a re-implementation of the XSD schema generator, which was previously available as a separate package ^1. These schema files provide auto-complete in IDEs (like PHPStorm) for all available ViewHelpers in a composer project.
The
bin/fluid
CLI command now supports the additional commandschema
, which scans the whole composer projects for valid ViewHelper classes. The class in question needs to meet the following requirements, which enforces already-existing conventions:ViewHelper.php
ViewHelpers
, which serves as a divider between a Fluid namespace and its ViewHelpersViewHelper
These conditions are checked by
ViewHelperMetadataFactory
, which then creates the correspondingViewHelperMetadata
value object. TheSchemaGenerator
then receives a list ofViewHelperMetadata
objects as well as an XML namespace (likehttp://typo3.org/ns/TYPO3Fluid/Fluid/ViewHelpers
) and generates an xsd schema file that describes the ViewHelper and its arguments. TheConsoleRunner
collects these files, creates unique file names and writes them asschema_*.xsd
files to the destination folder, specified with--destination
.IDEs either pick up those files automatically or need to be configured manually to do so.