How can I load data i.e $mytweets
into a specific div
within a specific template/view i.e footer.php
?
I have twitteruserfeed.php
as my Controller for getting the tweets, but I don't know how to present it within an already existing.
HTML:
<div id="fresh-tweetfeed"> $mytweets GOES HERE </div>
PHP:
class TwitterUserFeed extends CI_Controller
{
public function __construct()
{
parent::__construct();
}
public function getTweets()
{
$params = array(
'userName' => 'RowlandBiznez',
'consumerKey' => 'hgfhhgffhg',
'consumerSecret' => 'hhffhfghfhf',
'accessToken' => 'hfhhhfhhf',
'accessTokenSecret' => 'hfhfhfhfhhfhfh',
'tweetLimit' => 5 // the no of tweets to be displayed
);
$this->load->library('twitter', $params);
$tweets = $this->twitter->getHomeTimeLine();
$this->load->helper('tweet_helper');
$mytweets = getTweetsHTML($tweets);
echo $mytweets;
}
}
I also have a helper file tweet_helper.php. Help me out with this presentation.