Support Joomla!

references:joomla.framework:document:jdocument-__construct

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:

  • lineend - the character used to mark the end of the line. This attribute is set using the setLineEnd function.
  • charset - the character set of the document. This attribute is set using the setCharset function.
  • language - the language of the document. This attribute is set using the setLang function.
  • tab - the tab delimeter of the document. This attribute is set using the setTab function.

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);
 
references/joomla.framework/document/jdocument-__construct.txt (622 views) · Last modified: 2007/08/15 14:58