AppCmsExtensionException example

$templateFiles = (new Finder())
                ->files()
                ->name('preview.html')
                ->in(sprintf('%s/cms/blocks/%s', $cmsExtensions->getPath()$blockName));

            foreach ($templateFiles as $templateFile) {
                return $templateFile->getContents();
            }
        } catch (\Exception) {
        }

        throw new AppCmsExtensionException(sprintf('Preview file for block "%s" is missing', $blockName));
    }

    public function getStylesForBlock(CmsExtensions $cmsExtensions, string $blockName): string
    {
        try {
            $styleFiles = (new Finder())
                ->files()
                ->name('styles.css')
                ->in(sprintf('%s/cms/blocks/%s', $cmsExtensions->getPath()$blockName));

            foreach ($styleFiles as $styleFile) {
                
Home | Imprint | This part of the site doesn't use cookies.