Hello Necrominus (and the others) and a huge thanks to you : your job is awesome !
but… unfortunately, there is a but.
I’ve set my environment and everything is working fine until I wanted to put new methods in my controller.
The idea was to put the “fb_get_me” in the __construct method to check if the user is ok for each of the called methods.
So I set up this :
class Dashboard extends CI_Controller {
public $userId = null;
function __construct()
{
parent::__construct();
// The fb_ignited library is already auto-loaded so call the user and app.
$this->fb_me = $this->fb_ignited->fb_get_me(true);
$this->fb_app = $this->fb_ignited->fb_get_app();
$this->userId = $this->fb_me['id'];
}
}
And everything is working fine.
Then I created other methods (shortened for clarity):
public function index()
{
//the code you provide in the example PLUS a link to "dashboard/listAll"
}
public function listAll()
{
$data['pictures'] = $this->M_picture->getPictures(); // Retrieve pictures list
$this->load->view('show_pictures', $data);
}
public function vote($for)
{
//do stuff
$this->session->set_flashdata('ok', "Hey hey, vote okay !");
redirect('dashboard');
}
Within the “show_pictures” view there is a link targetting
<?php echo anchor('dashboard/vote/10', 'Vote for image'); ?>
So I come to my application, click on “dashboard/listAll”, see all the images and want to vote for one.
So I click “dashboard/vote/10” and this method is never called :(
I made some tests and noticed that the
$this->fb_me = $this->fb_ignited->fb_get_me(true);
was the “problem” here.
Could you please tell me what am I doing wrong ?
Thank you so much in advance !