/** * Inject the composed parser into the retrieved renderer instance * * @param Renderer\AbstractRenderer $instance * @return void */ public function injectParser($instance) { $parser = $this->getParser(); if ($parser === null) { return; } $instance->setParser($parser); }
/** * Constructor * * @param array|\Zend\Config\Config $options * * @todo make constructor compliant with new configuration standards * * @return void */ public function __construct($options = array()) { if ($options instanceof Config) { $options = $options->toArray(); } if (isset($options['markups'])) { if (!isset($options['markups']['Zend_Markup_Root'])) { $options['markups'] = array('Zend_Markup_Root' => new RootMarkup()); } } parent::__construct($options); }
/** * Set the renderer instance * * @param \Zend\Markup\Renderer\AbstractRenderer $renderer * * @return \Zend\Markup\Renderer\Markup\AbstractMarkup */ public function setRenderer(AbstractRenderer $renderer) { $this->_renderer = $renderer; $this->setEncoding($renderer->getEncoding()); return $this; }
/** * Execute a single replace token * * @param \Zend\Markup\Token $token * @param array $markup * @return string */ protected function _executeSingleReplace(Token $token, $markup) { if (isset($markup['tag'])) { if (!isset($markup['attributes'])) { $markup['attributes'] = array(); } $attrs = self::renderAttributes($token, $markup['attributes']); return "<{$markup['tag']}{$attrs} />"; } return parent::_executeSingleReplace($token, $markup); }