Exemplo n.º 1
0
 /**
  * Set <style> elements
  *
  * @return void
  */
 public function setHeadStyles()
 {
     foreach ($this->getOptions() as $headStyle => $options) {
         $content = array_key_exists('content', $options) && isset($options['content']) ? $options['content'] : null;
         $placement = array_key_exists('placement', $options) && isset($options['placement']) ? $options['placement'] : 'APPEND';
         $attributes = array_key_exists('attributes', $options) && isset($options['attributes']) ? $options['attributes'] : array();
         $this->_view->headStyle($content, $placement, $attributes);
     }
 }
Exemplo n.º 2
0
 /**
  * Injects additional scripts and styles,
  * that was linked to headScript after it was outputed
  * This method allows to call scripts from Axis_Box
  *
  * @param string $pageOutput
  */
 public function filter($pageOutput)
 {
     $head = substr($pageOutput, 0, strpos($pageOutput, '</head>'));
     if (empty($head)) {
         return $pageOutput;
     }
     $pageOutput = str_replace(array('{{headStyle}}', '{{headLink}}', '{{headScript}}'), array($this->_view->headStyle()->toString(), $this->_view->headLink()->toString(), $this->_view->headScript()->toString()), $pageOutput);
     return $pageOutput;
 }
Exemplo n.º 3
0
 /**
  * _responseHtml
  *
  * @return void
  */
 private function _responseHtml()
 {
     $body = $this->_viewRenderer->getResponse()->getBody();
     $respHeader = "{$this->_view->doctype()}\n        <html>\n        <head>\n        {$this->_view->headMeta()}\n        {$this->_view->headTitle()}\n        {$this->_view->headStyle()}\n        {$this->_view->headLink()}\n        {$this->_view->headScript()}\n        {$this->_view->dojo()}\n        </head>";
     $respBody = "<body>{$body}</body>";
     $respFooter = "</html>";
     $this->_viewRenderer->getResponse()->setBody($respHeader . $respBody . $respFooter);
 }