Welcome Guest, Not a member yet? Register   Sign In
Beginner getting a grasp of MVC/CI/PHP and Twitter library
#5

[eluser]jpcody[/eluser]
All right, I've decided to take some steps backwards to try and fix my problem. I've attempted to take the model out of the picture to make sure I can make it work with just the controller and the view. Alas, I cannot.

I'm attempting to use the following:

Code:
<?php
class Feed extends Controller {

    function index()
    {
        $this->twitter->get_user('jpcody');
        $data['tweet'] = $this->twitter->user_timeline('jpcody',2);
        $this->load->view('tweets', $data);
    }
}

And then cycling through it in the view like so:

Code:
<p>hello world!</p>

<p>
&lt;?php echo is_array($tweet) ? 'Array' : 'Not'; ?&gt;
&lt;?php foreach($tweet as $t): ?&gt;
&lt;?php echo $t; ?&gt;
&lt;?php endforeach; ?&gt;
</p>

It appears the user_timeline variable is not being stored as an array or I am screwing it up somehow. Any ideas?


Messages In This Thread
Beginner getting a grasp of MVC/CI/PHP and Twitter library - by El Forum - 09-14-2009, 09:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB