JApplication/ construct: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Class constructor.
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</... |
m removing red link to edit, no existant pages |
||
| Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[< | <nowiki>[<! removed edit link to red link >]</nowiki> | ||
</span> | </span> | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 69: | Line 69: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[< | <nowiki>[<! removed edit link to red link >]</nowiki> | ||
</span> | </span> | ||
<! removed transcluded page call, red link never existed > | |||
===Examples=== | ===Examples=== | ||
| Line 84: | Line 84: | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API16]] | |||
Revision as of 01:57, 13 May 2013
Description
Class constructor.
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
__construct($config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $config | array() | A client identifier. |
Defined in
libraries/joomla/application/application.php
Importing
jimport( 'joomla.application.application' );
Source Body
public function __construct($config = array())
{
jimport('joomla.utilities.utility');
jimport('joomla.error.profiler');
// Set the view name.
$this->_name = $this->getName();
$this->_clientId = $config['clientId'];
// Enable sessions by default.
if (!isset($config['session'])) {
$config['session'] = true;
}
// Set the session default name.
if (!isset($config['session_name'])) {
$config['session_name'] = $this->_name;
}
// Set the default configuration file.
if (!isset($config['config_file'])) {
$config['config_file'] = 'configuration.php';
}
// Create the configuration object.
$this->_createConfiguration(JPATH_CONFIGURATION.DS.$config['config_file']);
// Create the session if a session name is passed.
if ($config['session'] !== false) {
$this->_createSession(JUtility::getHash($config['session_name']));
}
$this->set('requestTime', gmdate('Y-m-d H:i'));
// Used by task system to ensure that the system doesn't go over time.
$this->set('startTime', JProfiler::getmicrotime());
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />