Skip to content

Instantly share code, notes, and snippets.

Johndllee / controllers-list.php
Last active Aug 29, 2015
mycitest/list/index/10 ->error message 404 Page Not Found
View controllers-list.php
class Lists extends CI_Controller {
private $limit = 10;
public function __construct() {
//Set error
$this->session->set_flashdata('need_login', 'Sorry, you need to be logged in to view the List');
Johndllee / application\controllers\home.php
Last active Aug 29, 2015
integrate the simple CRUD and login system
View application\controllers\home.php
class Home extends CI_Controller {
public function index(){
//Get the logged in users id
$user_id = $this->session->userdata('user_id');
//Get all lists from the model
// $this->load->library('/controllers/person'); to load the library
$data['person'] = $this->Person_model->list_all();
//$data['lists'] = $this->List_model->get_all_lists($user_id);