english/libraries/joomla/document/feed/feed.php
/**
	 * Render the document
	 *
	 * @param   boolean  $cache   If true, cache the output
	 * @param   array    $params  Associative array of attributes
	 *
	 * @return  The rendered data
	 *
	 * @since  11.1
	 */
Render the document
@param   boolean  $cache   If true, cache the output
@param   array    $params  Associative array of attributes

@return  The rendered data


Render the document @param boolean $cache If true cache the output @param array $params Associative array of attributes @return The rendered data
public function render($cache = false, $params = array())
	{
		global $option;
		$type = JRequest::getCmd('type', 'rss');
		$cache		= 0;
		$cache_time = 3600;
		$cache_path = JPATH_CACHE;
		$file = strtolower(str_replace('.', '', $type));
		$file = $cache_path . '/' . $file.'_'.$option.'.xml';
		$renderer = $this->loadRenderer(($type) ? $type : 'rss');
		if (!is_a($renderer, 'JDocumentRenderer')) {
			JError::raiseError(404, JText::_('JGLOBAL_RESOURCE_NOT_FOUND'));
		}
		$this->setMimeEncoding($renderer->getContentType());
		$data	= "<?xml version=\"1.0\" encoding=\"".$this->_charset."\"?>\n";
		$data	.= "<!-- generator=\"".$this->getGenerator()."\" -->\n";
		foreach ($this->_styleSheets as $src => $attr) {
			$data .= "<?xml-stylesheet href=\"$src\" type=\"".$attr['mime']."\"?>\n";
		}
		$data .= $renderer->render();
		parent::render();
		return $data;
	}
public function render ( $ cache = false , $ params = array ( ) ) { global $ option ; $ type = JRequest :: getCmd ( 'type' , 'rss' ) ; $ cache = 0 ; $ cache_time = 3600 ; $ cache_path = JPATH_CACHE ; $ file = strtolower ( str_replace ( '.' , '' , $ type ) ) ; $ file = $ cache_path . '/' . $ file . '_' . $ option . '.xml' ; $ renderer = $ this -> loadRenderer ( ( $ type ) ? $ type : 'rss' ) ; if ( ! is_a ( $ renderer , 'JDocumentRenderer' ) ) { JError :: raiseError ( 404 , JText :: _ ( 'JGLOBAL_RESOURCE_NOT_FOUND' ) ) ; } $ this -> setMimeEncoding ( $ renderer -> getContentType ( ) ) ; $ data = " <?xml version= \" 1.0 \"  encoding= \" " . $ this -> _charset . " \" ?> \n " ; $ data .= " <!-- generator= \" " . $ this -> getGenerator ( ) . " \"  --> \n " ; foreach ( $ this -> _styleSheets as $ src => $ attr ) { $ data .= " <?xml-stylesheet href= \" $ src \"  type= \" " . $ attr [ 'mime' ] . " \" ?> \n " ; } $ data .= $ renderer -> render ( ) ; parent :: render ( ) ; return $ data ; }
Render the document
 @param   boolean  $cache   If true, cache the output
 @param   array    $params  Associative array of attributes
Render the document @param boolean $cache If true cache the output @param array $params Associative array of attributes
// Get the feed type /*
		 * Cache TODO In later release
		 */ // set filename for rss feeds // Instantiate feed renderer and set the mime encoding // Output // Generate prolog // Generate stylesheet links // Render the feed