JMenu/getItem: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Get menu item by id
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
</span>
{... |
No edit summary |
||
| Line 9: | Line 9: | ||
===Syntax=== | ===Syntax=== | ||
<source lang="php">getItem($id)</source> | <source lang="php">& getItem($id)</source> | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 32: | Line 32: | ||
===Source Body=== | ===Source Body=== | ||
<source lang="php"> | <source lang="php"> | ||
function getItem($id) | function &getItem($id) | ||
{ | { | ||
$result = null; | $result = null; | ||
Revision as of 22:10, 22 March 2010
Description
Get menu item by id
Template:Description:JMenu/getItem
Syntax
& getItem($id)
| Parameter Name | Default Value | Description |
|---|---|---|
| $id | The item id |
Returns
mixed The item object, or null if not found
Defined in
libraries/joomla/application/menu.php
Importing
jimport( 'joomla.application.menu' );
Source Body
function &getItem($id)
{
$result = null;
if (isset($this->_items[$id])) {
$result = &$this->_items[$id];
}
return $result;
}
[Edit See Also] Template:SeeAlso:JMenu/getItem
Examples
<CodeExamplesForm />