/** @inheritdoc */ public function render(ObjectInterface $handler) { /** @var HandlerInterface $handler */ $templateStr = Config::get(['renderer', 'templates', $handler->getTemplate(), 'handler']); $template = new Template($templateStr); return $template->getString($this, $handler); }
/** * @param FormInterface $form * * @return string */ public function result(FormInterface $form) { if ($form->getStatus() == Form::STATUS_SHOW_RESULT) { $templateStr = Config::get(['renderer', 'templates', $form->getTemplate(), 'result']); $template = new Template($templateStr); return $template->getString($this, $form); } return ''; }
public function options(Field\ListField $field) { $templateStr = Config::get(['renderer', 'templates', $field->getTemplate(), 'checkSetOption']); $template = new Template($templateStr); $options = ''; foreach ($field->options() as $option) { $options .= $template->getString($this, $field, $option); } return $options; }
/** * @param FormInterface|BlockInterface|FieldInterface $object * * @return string */ public function errors($object) { $errors = $object->getErrors(); if (empty($errors)) { return ''; } $templateStr = Config::find(['renderer'], ['templates', $object->getTemplate(), 'errors'], $object->getClass(), ''); $template = new Template($templateStr); return $template->getString($this, $object); }
/** * @param BlockInterface|FieldInterface $block * @param bool $check * * @return string */ public function deleteButton($block, $check = true) { $res = ''; if ((int) $block->getName() != 0 || count($block->getParent()->children()) > 1 || !$check) { $templateStr = Config::get(['renderer', 'templates', $block->getTemplate(), 'deleteButton']); $template = new Template($templateStr); $res = $template->getString($this, $block); } return $res; }
/** @inheritdoc */ public function render(ObjectInterface $block) { /** @var BlockInterface $block */ if ($block->isRepeatable()) { $templateStr = Config::get(['renderer', 'templates', $block->getTemplate(), 'repeatBlock']); } elseif ($block->isRepeatableContainer()) { $templateStr = Config::get(['renderer', 'templates', $block->getTemplate(), 'repeatContainer']); } else { $templateStr = Config::get(['renderer', 'templates', $block->getTemplate(), 'block']); } $template = new Template($templateStr); return $template->getString($this, $block); }
public function render(ObjectInterface $attribute) { $template = null; /** @var KeyValuePair $attribute */ if ($attribute->isCanBeShort()) { $template = new Template(Config::get(['renderer', 'templates', 'default', 'shortAttribute'], '')); } else { $template = new Template(Config::get(['renderer', 'templates', 'default', 'attribute'], '')); } if ($template === null) { return ''; } return $template->getString($this, $attribute); }
protected function processMessageTemplate($messageTemplate) { $template = new Template($messageTemplate); return $template->getString($this); }
/** * @param FormInterface|BlockInterface|FieldInterface $object * * @return string */ public function label($object) { $templateStr = Config::find(['renderer'], ['templates', $object->getTemplate(), 'label'], $object->getClass(), ''); $template = new Template($templateStr); return $template->getString($this, $object); }