JMenu/ 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>
</span>
... |
No edit summary |
||
| Line 32: | Line 32: | ||
===Source Body=== | ===Source Body=== | ||
<source lang="php"> | <source lang="php"> | ||
function __construct($options = array()) | |||
{ | { | ||
$this->load(); //load the menu items | $this->load(); //load the menu items | ||
foreach ($this->_items as $k => $item) { | foreach ($this->_items as $k => $item) | ||
{ | |||
if ($item->home) { | if ($item->home) { | ||
$this->_default = $item->id; | $this->_default = $item->id; | ||
Revision as of 22:10, 22 March 2010
Description
Class constructor
Template:Description:JMenu/ construct
Syntax
__construct($options=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $options | array() |
Returns
boolean True on success
Defined in
libraries/joomla/application/menu.php
Importing
jimport( 'joomla.application.menu' );
Source Body
function __construct($options = array())
{
$this->load(); //load the menu items
foreach ($this->_items as $k => $item)
{
if ($item->home) {
$this->_default = $item->id;
}
}
}
[Edit See Also] Template:SeeAlso:JMenu/ construct
Examples
<CodeExamplesForm />