API15

JPlugin/ construct

From Joomla! Documentation

< API15:JPlugin
Revision as of 17:17, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Constructor <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> {{...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Constructor

[Edit Descripton]

Template:Description:JPlugin/ construct

Syntax[edit]

__construct(&$subject, $config=array())
Parameter Name Default Value Description
$config array()

Defined in[edit]

libraries/joomla/plugin/plugin.php

Importing[edit]

jimport( 'joomla.plugin.plugin' );

Source Body[edit]

function __construct(& $subject, $config = array())
{
        //Set the parameters
        if ( isset( $config['params'] ) ) {

                if(is_a($config['params'], 'JParameter')) {
                        $this->params = $config['params'];
                } else {
                        $this->params = new JParameter($config['params']);
                }
        }

        if ( isset( $config['name'] ) ) {
                $this->_name = $config['name'];
        }

        if ( isset( $config['type'] ) ) {
                $this->_type = $config['type'];
        }

        parent::__construct($subject);
}

[Edit See Also] Template:SeeAlso:JPlugin/ construct

Examples[edit]

<CodeExamplesForm />