示例#1
0
 /**
  * @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);
 }
示例#2
0
 /**
  * @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;
 }
示例#3
0
 /**
  * @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);
 }