JStream/deleteContextEntry: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Deletes a particular setting from a context
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JStream/deleteContextEntry|Edit Descri... |
m clean up |
||
| Line 2: | Line 2: | ||
Deletes a particular setting from a context | Deletes a particular setting from a context | ||
{{Description:JStream/deleteContextEntry}} | |||
{{subst:Description:JStream/deleteContextEntry}} | |||
===Syntax=== | ===Syntax=== | ||
| Line 56: | Line 54: | ||
</source> | </source> | ||
{{subst:SeeAlso:JStream/deleteContextEntry}} | |||
{{SeeAlso:JStream/deleteContextEntry}} | |||
===Examples=== | ===Examples=== | ||
Revision as of 14:26, 24 March 2017
Description
Deletes a particular setting from a context
{{subst:Description:JStream/deleteContextEntry}}
Syntax
deleteContextEntry($wrapper, $name)
| Parameter Name | Default Value | Description |
|---|---|---|
| $wrapper | The wrapper to use | |
| $name | The option to unset |
Defined in
libraries/joomla/filesystem/stream.php
Importing
jimport( 'joomla.filesystem.stream' );
Source Body
function deleteContextEntry($wrapper, $name)
{
// check the wrapper is set
if(isset($this->_contextOptions[$wrapper]))
{
// check that entry is set for that wrapper
if(isset($this->_contextOptions[$wrapper][$name]))
{
// unset the item
unset($this->_contextOptions[$wrapper][$name]);
// check that there are still items there
if(!count($this->_contextOptions[$wrapper])) {
// clean up an empty wrapper context option
unset($this->_contextOptions[$wrapper]);
}
}
}
// rebuild the context and apply it to the stream
$this->_buildContext();
}
{{subst:SeeAlso:JStream/deleteContextEntry}}
Examples
<CodeExamplesForm />