Source of file CompositeField.php
Size: 1,432 Bytes - Last Modified: 2021-12-23T11:00:16+00:00
/var/www/docs.ssmods.com/process/src/src/Form/CompositeField.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | <?php namespace zauberfisch\NamespaceTemplates\Form; use zauberfisch\NamespaceTemplates\View\SSViewer; class CompositeField extends \CompositeField { /** * Returns an array of templates to use for rendering {@link FieldHolder}. * * @return array */ public function getTemplates() { return $this->__templates($this->getTemplate()); } /** * Returns an array of templates to use for rendering {@link FieldHolder}. * * @return array */ public function getFieldHolderTemplates() { return $this->__templates( $this->getFieldHolderTemplate(), '_holder' ); } /** * Returns an array of templates to use for rendering {@link SmallFieldHolder}. * * @return array */ public function getSmallFieldHolderTemplates() { return $this->__templates( $this->getSmallFieldHolderTemplate(), '_holder_small' ); } /** * Generate an array of class name strings to use for rendering this form field into HTML. * * @param string $customTemplate * @param string $customTemplateSuffix * * @return array */ protected function __templates($customTemplate = null, $customTemplateSuffix = null) { $templates = SSViewer::get_templates_by_class($this->class, $customTemplateSuffix, __CLASS__); if (!$templates) { throw new \Exception("No template found for {$this->class}"); } if($customTemplate) { array_unshift($templates, $customTemplate); } return $templates; } } |