6
SimplePie - Smarty example
//PHP File
require_once ('autoloader.php');
$feed = new SimplePie();
$feed->set_feed_url('http://feeds.feedburner.com/TechCrunch/');
$feed->init();
$feed->handle_content_type();
if ($feed->error()) {
echo $feed->error();
}
foreach ($feed->get_items() as $item):
$i['get_title'] = $item->get_title();
$i['get_description'] = $item->get_description();
$items[] = $i;
endforeach;
$smarty->assign('items', @$items);
//Template File
{foreach from=$items item=posts}
<div>{$posts.get_title}</div>
<div>{$posts.get_description}</div>
{/foreach}
Interserver | Standard & VPS Cloud Hosting | $2.50 /Month
Flexible VPS hosting platform to deploy your online projects.
Economical and balanced between processor cores, memory and storage
rated 6 times
(6)
(0)
comments: 0 / hits: 2041
/ 4 years ago, fri, may 10, 19, 12:17:22
More From
» PHP
Comments
There are no comments for this Snippet yet