Actions

API16

JDocument

From Joomla! Documentation

Revision as of 17:43, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

[Edit Descripton] JDocument is an abstract class which provides a number of methods and properties appropriate for a range of document types. Some of the methods listed will be overridden by the child class so you should check the child class documentation for further information.

Contents

Defined in

libraries/joomla/document/document.php

Methods

Method name Description
__construct Class constructor
setType Set the document type
getType Returns the document type
getHeadData Get the document head data
setHeadData Set the document head data
getBuffer Get the contents of the document buffer
setBuffer Set the contents of the document buffer
getMetaData Gets a meta tag.
setMetaData Sets or alters a meta tag.
addScript Adds a linked script to the page
addScriptDeclaration Adds a script to the page
addStyleSheet Adds a linked stylesheet to the page
addStyleDeclaration Adds a stylesheet declaration to the page
setCharset Sets the document charset
getCharset Returns the document charset encoding.
setLanguage Sets the global document language declaration. Default is English (en-gb).
getLanguage Returns the document language.
setDirection Sets the global document direction declaration. Default is left-to-right (ltr).
getDirection Returns the document language.
setTitle Sets the title of the document
getTitle Return the title of the document.
setBase Sets the base URI of the document
getBase Return the base URI of the document.
setDescription Sets the description of the document
getDescription Return the title of the page.
setLink Sets the document link
getLink Returns the document base url
setGenerator Sets the document generator
getGenerator Returns the document generator
setModifiedDate Sets the document modified date
getModifiedDate Returns the document modified date
setMimeEncoding Sets the document MIME encoding that is sent to the browser.
setLineEnd Sets the line end style to Windows, Mac, Unix or a custom string.
setTab Sets the string used to indent HTML
loadRenderer Load a renderer
parse Parses the document and prepares the buffers
render Outputs the document
getInstance Returns the global JDocument object, only creating it if it doesn't already exist.

Importing

jimport( 'joomla.document.document' );

[Edit See Also] SeeAlso:JDocument

Examples

<CodeExamplesForm />

Adding support for new document types

New document types are added by creating a new sub-directory under the /libraries/joomla/document/ directory with the same name as the type. For example, to add a document type called "mytype", you would create the directory /libraries/joomla/document/mytype. In this directory you must then create a file called mytype.php which will contain the class definition for JDocumentMytype which extends JDocument. Look at the code for existing document types to see what needs to be done.


Chris Davenport 12:35, 17 April 2011 (CDT) Edit comment