/** * @return array */ protected function getTemplateTypeChoices() { $templateTypeChoices = []; $finder = new Finder(); $finder->files()->in($this->cmsBlockConfig->getBlockSchemaPath()); /* @var \Symfony\Component\Finder\SplFileInfo $file */ foreach ($finder as $file) { $extension = $file->getExtension(); $templateType = $file->getBasename('.' . $extension); $templateTypeChoices[$templateType] = $templateType; } return $templateTypeChoices; }
/** * @param string $templateName * * @return string */ protected function getSchemaPath($templateName) { return sprintf('%s/%s.json', $this->cmsBlockConfig->getBlockSchemaPath(), $templateName); }