diff --git a/www/application/controllers/All_Tweets.php b/www/application/controllers/All_Tweets.php index d5bcca1..8816ca7 100644 --- a/www/application/controllers/All_Tweets.php +++ b/www/application/controllers/All_Tweets.php @@ -12,7 +12,9 @@ function __Construct(){ public function index() { $this->data['posts'] = $this->All_Tweets_Model->getPosts(); // calling Post model method getPosts() + $this->load->view('templates/header', NULL); $this->load->view('home', $this->data); // load the view file , we are passing $data array to view file + $this->load->view('templates/footer', NULL); } } diff --git a/www/application/controllers/User_Tweets.php b/www/application/controllers/User_Tweets.php index c97e90b..60769fc 100644 --- a/www/application/controllers/User_Tweets.php +++ b/www/application/controllers/User_Tweets.php @@ -1,18 +1,17 @@ load->library('session'); $this->load->database(); // load database - $this->load->model('Users_Tweets_Model'); // load model + $this->load->model('User_Tweets_Model'); // load model $this->output->enable_profiler(TRUE); } public function index() { - $this->data['posts'] = $this->Users_Tweets_Model->getPosts(); // calling Post model method getPosts() + $this->data['posts'] = $this->User_Tweets_Model->getPosts(); // calling Post model method getPosts() $this->load->view('user', $this->data); // load the view file , we are passing $data array to view file } diff --git a/www/application/models/Users_Tweets_Model.php b/www/application/models/User_Tweets_Model.php similarity index 91% rename from www/application/models/Users_Tweets_Model.php rename to www/application/models/User_Tweets_Model.php index e67ae08..002bf21 100644 --- a/www/application/models/Users_Tweets_Model.php +++ b/www/application/models/User_Tweets_Model.php @@ -2,8 +2,6 @@ class User_Tweets_Model extends CI_Model { function getPosts(){ - - $_SESSION['user_id'] = $id; $this->db->select("first_name, last_name, username, tweet, date_time"); diff --git a/www/application/views/home.php b/www/application/views/home.php index 7540c13..bf2eaeb 100644 --- a/www/application/views/home.php +++ b/www/application/views/home.php @@ -19,7 +19,7 @@ - +