- md5
- 3ccea02b3dec42a89b068880ba2d493a
- sha1
- 8d2bcdc4cdebe14158b5bbd4a1c3e8c09ae60bf8
- sha256
- 14e88d5f1ea2cedc1e1690d4dfb2e6a6ca40d65d614d5bdaa8d4b4cc43606b91
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2019 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;
use Joomla\CMS\Factory as CmsFactory;
/**
* XmlDocument class, provides an easy interface to parse and display XML output
*
* @since 1.7.0
*/
class XmlDocument extends Document
{
/**
* Document name
*
* @var string
* @since 3.0.0
*/
protected $name = 'joomla';
/**
* Class constructor
*
* @param array $options Associative array of options
*
* @since 1.7.0
*/
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 1.7.0
*/
public function render($cache = false, $params = array())
{
parent::render();
CmsFactory::getApplication()->setHeader('Content-disposition', 'inline; filename="' . $this->getName() . '.xml"', true);
return $this->getBuffer();
}
/**
* Returns the document name
*
* @return string
*
* @since 1.7.0
*/
public function getName()
{
return $this->name;
}
/**
* Sets the document name
*
* @param string $name Document name
*
* @return XmlDocument instance of $this to allow chaining
*
* @since 1.7.0
*/
public function setName($name = 'joomla')
{
$this->name = $name;
return $this;
}
}
No other release has this exact content. See every version of this file.