MetaModels\BackendIntegration\BackendModuleBuilder::buildIcon PHP Метод

buildIcon() защищенный Метод

Build a 16x16 sized representation of the passed icon if it exists or fallback to the default icon otherwise.
protected buildIcon ( string $icon ) : string
$icon string The path to the icon (relative to TL_ROOT).
Результат string The path to the generated icon.
    protected function buildIcon($icon)
    {
        // Determine image to use.
        if ($icon && file_exists(TL_ROOT . '/' . $icon)) {
            $event = new ResizeImageEvent($icon, 16, 16);
            $this->getEventDispatcher()->dispatch(ContaoEvents::IMAGE_RESIZE, $event);
            return $event->getResultImage();
        }
        return 'system/modules/metamodels/assets/images/icons/metamodels.png';
    }