[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * @package Joomla.Site 5 * @subpackage mod_feed 6 * 7 * @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org> 8 * @license GNU General Public License version 2 or later; see LICENSE.txt 9 */ 10 11 namespace Joomla\Module\Feed\Site\Helper; 12 13 use Joomla\CMS\Feed\FeedFactory; 14 use Joomla\CMS\Language\Text; 15 16 // phpcs:disable PSR1.Files.SideEffects 17 \defined('_JEXEC') or die; 18 // phpcs:enable PSR1.Files.SideEffects 19 20 /** 21 * Helper for mod_feed 22 * 23 * @since 1.5 24 */ 25 class FeedHelper 26 { 27 /** 28 * Retrieve feed information 29 * 30 * @param \Joomla\Registry\Registry $params module parameters 31 * 32 * @return \Joomla\CMS\Feed\Feed|string 33 */ 34 public static function getFeed($params) 35 { 36 // Module params 37 $rssurl = $params->get('rssurl', ''); 38 39 // Get RSS parsed object 40 try { 41 $feed = new FeedFactory(); 42 $rssDoc = $feed->getFeed($rssurl); 43 } catch (\Exception $e) { 44 return Text::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED'); 45 } 46 47 if (empty($rssDoc)) { 48 return Text::_('MOD_FEED_ERR_FEED_NOT_RETRIEVED'); 49 } 50 51 if ($rssDoc) { 52 return $rssDoc; 53 } 54 } 55 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |