Documentation Menu

1.5 Template Project

The Joomla! Documentation Working Group is running a project to develop detailed reference and tutorial material on Joomla! 1.5 templates.  There is a project page on the documentation wiki where you can see the work in progress and help us by contributing your knowledge.

Who's Online

We have 16 guests online

Help Site License

The Joomla! Help Site content is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution NonCommercial ShareAlike 2.5. Some parts of this website may be subject to other licenses.
Home arrow Manual arrow 11. API Reference arrow mosLoadComponent

mosLoadComponent PDF Print E-mail

Last reviewed: 18 Nov 2005, Joomla 1.0.3
phpDocumentor

mosLoadComponent

Loads (executes) the specified component.

This function loads the specified component by including the file in the component's directory bearing the name of the component with the extension .php.

This function does not return a value. The file is included with 'include', and not 'require'. Therefore, if the file is not found, a warning will be generated, but Joomla will continue to execute.

The specified component will be loaded. Before including the file for the component, the $database and $mainframe global variables are declared so that they will be in scope within the component being loaded.

Syntax

void mosLoadComponent ( string $name )

$name
is a string containing the name of the component to load. This component should exist in the directory /components/com_$name and there should be a file called $name.php in this directory.

Defined in

includes/template.php
(includes/frontend.php prior to Joomla 1.1)

Examples

Example: Loading the newsfeeds component

mosLoadComponent( 'newsfeeds' );

This will load the newsfeeds component. More specifically, it will include the file /components/com_newsfeeds/newsfeeds.php.


Please report any errors on this page to the Developer Documentation Forum.

Last Updated ( Tuesday, 03 January 2006 )
 
< Prev   Next >