API16

JDocumentRenderer: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{Description:JDocumentRenderer}} ===...
 
m clean up
Line 1: Line 1:
<span class="editsection" style="font-size:76%;">
[[JDocumentRenderer]] is an abstract class which provides a number of methods and properties to assist in rendering a particular document type.  Not all document types implement renderers in this way.  Some of the methods listed will be overridden by the child class so you should check the child class documentation for further information.
<nowiki>[</nowiki>[[Description:JDocumentRenderer|Edit Descripton]]<nowiki>]</nowiki>
</span>
{{Description:JDocumentRenderer}}


===Defined in===
===Defined in===
Line 25: Line 22:
<source lang="php">jimport( 'joomla.document.renderer' );</source>
<source lang="php">jimport( 'joomla.document.renderer' );</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JDocumentRenderer|Edit See Also]]<nowiki>]</nowiki>
{{subst:SeeAlso:JDocumentRenderer}}
</span>
{{SeeAlso:JDocumentRenderer}}


===Examples===
===Examples===

Revision as of 13:53, 24 March 2017

JDocumentRenderer is an abstract class which provides a number of methods and properties to assist in rendering a particular document type. Not all document types implement renderers in this way. Some of the methods listed will be overridden by the child class so you should check the child class documentation for further information.

Defined in

libraries/joomla/document/renderer.php

Methods

Method name Description
__construct Class constructor
render Renders a script and returns the results as a string
getContentType Return the content type of the renderer

Importing

jimport( 'joomla.document.renderer' );


{{subst:SeeAlso:JDocumentRenderer}}

Examples

<CodeExamplesForm />

Adding support for new document renderers

New renderer types are added by creating a new file in the renderer directory under the document type directory with the same name as the renderer. For example, to add a document renderer type called "myrenderer" for document type "mytype", you would create the file /libraries/joomla/document/mytype/renderer/myrenderer.php. This file will contain the class definition for JDocumentRendererMytype which extends JDocumentRenderer. Look at the code for existing document renderers to see what needs to be done.


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

JDocumentRenderer is an abstract class which provides a number of methods and properties to assist in rendering a particular document type. Not all document types implement renderers in this way. Some of the methods listed will be overridden by the child class so you should check the child class documentation for further information.

Defined in

libraries/joomla/document/renderer.php

Methods

Method name Description
__construct Class constructor
render Renders a script and returns the results as a string
getContentType Return the content type of the renderer

Importing

jimport( 'joomla.document.renderer' );



Examples

Code Examples

Adding support for new document renderers

New renderer types are added by creating a new file in the renderer directory under the document type directory with the same name as the renderer. For example, to add a document renderer type called "myrenderer" for document type "mytype", you would create the file /libraries/joomla/document/mytype/renderer/myrenderer.php. This file will contain the class definition for JDocumentRendererMytype which extends JDocumentRenderer. Look at the code for existing document renderers to see what needs to be done.


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