Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. MY_Controller:
  2.  
  3. <?php
  4.  
  5. class MY_Controller extends CI_Controller {
  6.  
  7. var $data;
  8.  
  9. function __construct()
  10. {
  11. parent::__construct();
  12.  
  13. $this->load->model('navigation_model');
  14.  
  15. $this->data['navigation_bar'] = $this->navigation_model->getMainNav();
  16.  
  17.  
  18.  
  19. if ($this->session->userdata('is_logged_in'))
  20. {
  21. $this->data['user_panel'] = 'user_panel_view';
  22. } else {
  23. $this->data['user_panel'] = 'login_form';
  24. }
  25. }
  26. }
  27. ?>
  28.  
  29. Welcome Controller:
  30.  
  31. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  32.  
  33. class Welcome extends MY_Controller {
  34.  
  35. function __construct()
  36. {
  37. parent::__construct();
  38. }
  39.  
  40. function index()
  41. {
  42. $this->data['title'] = "Maharishi Unniversity of Management: Chess Club";
  43. $this->data['main_content'] = 'welcome_view';
  44. $this->load->view('includes/template_view', $this->data);
  45. }
  46.  
  47. }
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement