loadTypes example

'Enlight_Controller_Action_Backend_EntitySearch_search' => 'onSearch',
        ];
    }

    public function onSearch(Enlight_Event_EventArgs $args)
    {
        /** @var Enlight_Controller_Action $controller */
        $controller = $args->get('subject');
        $model = $controller->Request()->getParam('model');

        if ($model === 'content_types') {
            $this->loadTypes($controller);

            return true;
        }

        try {
            $type = $this->provider->getType($model);
        } catch (RuntimeException $e) {
            return;
        }

        $label = $this->getLabelField($type);

        


    /** * Initializes the types. * * @throws UnexpectedTypeException if any registered type is not an instance of FormTypeInterface */
    private function initTypes(): void
    {
        $this->types = [];

        foreach ($this->loadTypes() as $type) {
            if (!$type instanceof FormTypeInterface) {
                throw new UnexpectedTypeException($type, FormTypeInterface::class);
            }

            $this->types[$type::class] = $type;
        }
    }

    /** * Initializes the type extensions. * * @throws UnexpectedTypeException if any registered type extension is not * an instance of FormTypeExtensionInterface */
Home | Imprint | This part of the site doesn't use cookies.