Developer corner

Target group: Developers, Integrators

Using the API

The API can be used like described in the schema manual. Use the TypeFactory for instantiating a model type class:

EXT:my_extension/Classes/Controller/MyController.php
<?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
    {
        // ...

        $comicStory = $this->typeFactory->create('ComicStory');

        // ...
    }
}

Using the view helpers

The Fluid view helpers can be used like described in the schema manual:

<schema:type.comicStory
   -id="https://example.org/#some-comic-story"
   name="some comic story"
/>

The Fluid namespace schema is the same as for the core vocabulary.