Example #1
0
 /**
  * render
  *
  * Render the alert as a HTML string.
  *
  * @param string       $content  The content that should be within the alert.
  * @param null|string  $title    The alert title message.
  * @param array        $options  Optional view helper options.
  *
  * @return string
  */
 public function render($content, $title = null, array $options)
 {
     if (!empty($options)) {
         $this->setOptions($options);
     }
     $title = $this->getTitle($title, $this->getOption('escape_title_html', true));
     $content = $this->getContent($content, $this->getOption('escape_content_html', true));
     if ($title) {
         $content = sprintf('<strong>%s</strong> %s', $title, $content);
         $this->setOption('escape_html', false);
     }
     return parent::render($content);
 }
 /**
  * render
  *
  * Return the HTML representation of the form element's label.
  *
  * @param ElementInterface  $element  The form element which label should be rendered.
  * @param array             $options  Optional view helper options.
  *
  * @return string
  */
 public function render(ElementInterface $element, array $options = [])
 {
     if (!empty($options)) {
         $this->setOptions($options);
     }
     $name = $element->getName();
     $label = $element->getLabel();
     if (empty($label) && false == $this->getOption('allow_empty_label', false)) {
         return '';
     }
     // Merge the label attributes
     $attributes = $this->getAttributes();
     if ($element instanceof LabelAwareInterface) {
         $attributes = array_merge($attributes, $element->getLabelAttributes());
     }
     if (!empty($name) && !isset($attributes['for'])) {
         $attributes['for'] = $name;
     }
     $this->setAttributes(array_unique($attributes));
     return parent::render($label);
 }
 /**
  * render
  *
  * Render the view helper as a HTML string.
  *
  * @param  ElementInterface  $element  The form element that should be rendered.
  * @param  array             $options  Optional view helper options.
  *
  * @return string
  */
 public function render(ElementInterface $element, array $options = [])
 {
     return parent::render($this->formRowHelper->render($element), $options);
 }
 /**
  * __construct
  *
  * Create the form element errors view helper.
  *
  * @param HelpText  $helpTextHelper  The help text view helper.
  * @param array     $options         Optional view helper options.
  */
 public function __construct(HelpText $helpTextHelper, array $options = [])
 {
     parent::__construct($options);
     $this->setHelpTextHelper($helpTextHelper);
 }