- md5
- 53a33ea3715745b08c1241dba9c57223
- sha1
- 1469eba2a27c2b29530ff277c8873f7870409856
- sha256
- 9e36e7965038d212dcdd4e5b95a52f9e46e0d50e82ceee8ef3779df9e123b6df
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Document;
defined('JPATH_PLATFORM') or die;
/**
* XmlDocument class, provides an easy interface to parse and display XML output
*
* @since 11.1
*/
class XmlDocument extends Document
{
/**
* Document name
*
* @var string
* @since 12.1
*/
protected $name = 'joomla';
/**
* Class constructor
*
* @param array $options Associative array of options
*
* @since 11.1
*/
public function __construct($options = array())
{
parent::__construct($options);
// Set mime type
$this->_mime = 'application/xml';
// Set document type
$this->_type = 'xml';
}
/**
* Render the document.
*
* @param boolean $cache If true, cache the output
* @param array $params Associative array of attributes
*
* @return string The rendered data
*
* @since 11.1
*/
public function render($cache = false, $params = array())
{
parent::render();
\JFactory::getApplication()->setHeader('Content-disposition', 'inline; filename="' . $this->getName() . '.xml"', true);
return $this->getBuffer();
}
/**
* Returns the document name
*
* @return string
*
* @since 11.1
*/
public function getName()
{
return $this->name;
}
/**
* Sets the document name
*
* @param string $name Document name
*
* @return XmlDocument instance of $this to allow chaining
*
* @since 11.1
*/
public function setName($name = 'joomla')
{
$this->name = $name;
return $this;
}
}
The same content is in 13 releases, Joomla 3.8.0-beta1 to 4.0.0-alpha2. See them all, or every version of this file.