/** * @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; }
/** * @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); }