JStream/removeFilter: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Remove a filter, either by resource (handed out from the append or prepend function alternatively via getting the filter list) bool Result of operation
<span class="... |
m preparing for archive only |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 3: | Line 3: | ||
===Syntax=== | ===Syntax=== | ||
| Line 18: | Line 16: | ||
!Description | !Description | ||
|- | |- | ||
| | | &$resource | ||
| | | | ||
| | | | ||
| Line 58: | Line 56: | ||
</source> | </source> | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=removeFilter | category=removeFilter | ||
category=JStream | category=JStream | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
Latest revision as of 02:07, 25 March 2017
Description
Remove a filter, either by resource (handed out from the append or prepend function alternatively via getting the filter list) bool Result of operation
Syntax
removeFilter(&$resource, $byindex=false)
| Parameter Name | Default Value | Description |
|---|---|---|
| &$resource | ||
| $byindex | false |
Returns
bool Result of operation
Defined in
libraries/joomla/filesystem/stream.php
Importing
jimport( 'joomla.filesystem.stream' );
Source Body
function removeFilter(&$resource, $byindex=false)
{
$res = false;
// Capture PHP errors
$php_errormsg = '';
$track_errors = ini_get('track_errors');
ini_set('track_errors', true);
if($byindex) {
$res = stream_filter_remove($this->filters[$resource]);
} else {
$res = stream_filter_remove($resource);
}
if($res && $php_errormsg) {
$this->setError($php_errormsg);
}
// restore error tracking to what it was before
ini_set('track_errors',$track_errors);
return $res;
}
Examples
Code Examples