Developer corner¶
Target group: Developers, Integrators
Table of Contents
Using the API¶
The API can be used like described in the schema manual. Use the TypeFactory
for instantiating a model type
class:
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Controller;
use Brotkrueml\Schema\Type\TypeFactory;
final class MyController
{
public function __construct(
private readonly TypeFactory $typeFactory,
) {
}
public function doSomething(): void
{
// ...
$busOrCoach = $this->typeFactory->create('BusOrCoach');
// ...
}
}
Using the view helpers¶
The Fluid view helpers can be used like described in the schema manual:
<schema:type.busOrCoach
-id="http://example.org/#some-bus"
name="some bus"
/>
The Fluid namespace schema
is the same as for the core vocabulary.