Source of file FormField.php
Size: 1,511 Bytes - Last Modified: 2021-12-23T11:00:16+00:00
/var/www/docs.ssmods.com/process/src/src/Form/FormField.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 | <?php namespace zauberfisch\NamespaceTemplates\Form; use zauberfisch\NamespaceTemplates\View\SSViewer; class FormField extends \FormField { /** * 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, \FormField::class); //$templates = \SSViewer::get_templates_by_class($this->class, '', __CLASS__); if (!$templates) { throw new \Exception("No template found for {$this->class}"); } if($customTemplate) { array_unshift($templates, $customTemplate); } return $templates; } } |