Table of Contents

__construct

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Document Class JDocument Method __construct Reference __construct() Never Work in Progress

This is the constructor for the class. It sets up the line end parameter, the character set, the language and the tab delimeter for the document if these parameters are passed. The constructor also sets up the name space and adds the module directories for the Function, OutputFilter and Renderer. The $type parameter is passed to the JTemplate constructor.

Syntax

JDocument __construct ( $type, $attributes )

$type string is a string specifying the type of the document (either HTML or TEX).
$attributes array Associative array of attributes.

The recognized settings for $attributes are:

Examples

This class is instantiated by the JApplication::getDocument function. Therefore, another instantiation should not be necessary. This function executes the following code:

Example

$attributes = array (
    'charset'  => 'utf-8',
    'lineend'  => 'unix',
    'tab'  => '  ',
    'language' => 'en-GB'
);
jimport('joomla.document.document');
$instance =& JDocument::getInstance('html', $attributes);