Beispiel #1
0
 /**
  * Retrieve view object
  *
  * @return \Zend\View\View
  */
 public function getView()
 {
     if (null === $this->_view) {
         $options = $this->getOptions();
         $this->_view = new \Zend\View\PhpRenderer($options);
         if (isset($options['doctype'])) {
             $this->_view->plugin('doctype')->setDoctype(strtoupper($options['doctype']));
         }
     }
     return $this->_view;
 }
Beispiel #2
0
 /**
  * String representation of dojo environment
  *
  * @return string
  */
 public function __toString()
 {
     if (!$this->isEnabled()) {
         return '';
     }
     $this->_isXhtml = $this->view->plugin('doctype')->isXhtml();
     if (DojoHelper::useDeclarative()) {
         if (null === $this->getDjConfigOption('parseOnLoad')) {
             $this->setDjConfigOption('parseOnLoad', true);
         }
     }
     if (!empty($this->_dijits)) {
         $this->registerDijitLoader();
     }
     $html = $this->_renderStylesheets() . PHP_EOL . $this->_renderDjConfig() . PHP_EOL . $this->_renderDojoScriptTag() . PHP_EOL . $this->_renderLayers() . PHP_EOL . $this->_renderExtras();
     return $html;
 }
Beispiel #3
0
 /**
  * Display the captcha
  *
  * @param Renderer $view
  * @param mixed $element
  * @return string
  */
 public function render(Renderer $view = null, $element = null)
 {
     $endTag = ' />';
     if ($view instanceof Pluggable) {
         $doctype = $view->plugin('doctype');
         if ($doctype && !$doctype->isXhtml()) {
             $endTag = '>';
         }
     }
     return '<img width="' . $this->getWidth() . '" height="' . $this->getHeight() . '" alt="' . $this->getImgAlt() . '" src="' . $this->getImgUrl() . $this->getId() . $this->getSuffix() . '"' . $endTag;
 }
Beispiel #4
0
 /**
  * Recurse through a form object, rendering errors
  *
  * @param  \Zend\Form\Form $form
  * @param  \Zend\View\Renderer $view
  * @return string
  */
 protected function _recurseForm(Form\Form $form, View $view)
 {
     $content = '';
     $custom = $form->getCustomMessages();
     if ($this->getShowCustomFormErrors() && count($custom)) {
         $content .= $this->getMarkupListItemStart() . $view->plugin('formErrors')->direct($custom, $this->getOptions()) . $this->getMarkupListItemEnd();
     }
     foreach ($form->getElementsAndSubFormsOrdered() as $subitem) {
         if ($subitem instanceof Form\Element && !$this->getOnlyCustomFormErrors()) {
             $messages = $subitem->getMessages();
             if (count($messages)) {
                 $subitem->setView($view);
                 $content .= $this->getMarkupListItemStart() . $this->renderLabel($subitem, $view) . $view->plugin('formErrors')->direct($messages, $this->getOptions()) . $this->getMarkupListItemEnd();
             }
         } elseif ($subitem instanceof Form\Form && !$this->ignoreSubForms()) {
             $content .= $this->getMarkupListStart() . $this->_recurseForm($subitem, $view) . $this->getMarkupListEnd();
         }
     }
     return $content;
 }