Actions

API16

Difference between revisions of "JFactory/getFeedParser"

From Joomla! Documentation

< API16:JFactory
(New page: ===Description=== Get a parsed XML Feed Source <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</now...)
 
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>[[Description:JFactory/getFeedParser|Edit Descripton]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
  
{{Description:JFactory/getFeedParser}}
+
<! removed transcluded page call, red link never existed >
  
 
===Syntax===
 
===Syntax===
Line 55: Line 55:
  
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JFactory/getFeedParser|Edit See Also]]<nowiki>]</nowiki>
+
<nowiki>[<! removed edit link to red link >]</nowiki>
 
</span>
 
</span>
{{SeeAlso:JFactory/getFeedParser}}
+
<! removed transcluded page call, red link never existed >
  
 
===Examples===
 
===Examples===
Line 70: Line 70:
 
  format= ,,,
 
  format= ,,,
 
</dpl>
 
</dpl>
 +
[[Category:Archived pages API16]]

Latest revision as of 23:06, 12 May 2013

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Get a parsed XML Feed Source

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

static getFeedParser($url, $cache_time=0)
Parameter Name Default Value Description
$url url for feed source
$cache_time 0 time to cache feed for (using internal cache mechanism)

Returns

mixed Parsed SimplePie object on success, false on failure

Defined in

libraries/joomla/factory.php

Importing

jimport( 'joomla.factory' );

Source Body

public static function getFeedParser($url, $cache_time = 0)
{
        jimport('simplepie.simplepie');
        if (!is_writable(JPATH_CACHE)) {
                $cache_time = 0;
        }
        $simplepie = new SimplePie($url, JPATH_CACHE, $cache_time);
        $simplepie->force_feed(true);
        if ($simplepie->init()) {
                return $simplepie;
        } else {
                JError::raiseWarning('SOME_ERROR_CODE', JText::_('JERROR_LOADING_FEED_DATA'));
        }
 
        return false;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />