anjhar

blog

Apr 29th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2.  
  3. class Blog extends CI_Controller {
  4. public function __construct(){
  5. parent::__construct();
  6. $this->load->model('kategori_model','kategori');
  7. $this->load->model('artikel_model','artikel');
  8. //$this->load->helper('url');
  9. //$this->load->library('input');
  10. $this->load->model('crud_model','crud');
  11. }
  12. /*
  13. public function index()
  14. {
  15. //echo 'anu';
  16. $arr['images'] = $this->crud->show('home');
  17. $arr['artikel'] = $this->artikel->show('artikel');
  18. $arr['page'] ='blog';
  19. $this->load->view('blog-style3',$arr);
  20. }
  21. *
  22. */
  23. function index(){
  24. $get = $this->db->get('artikel');
  25. $config['base_url'] = site_url().'/blog/index/';
  26. $config['per_page'] = 3;
  27. $config['total_rows'] = $get->num_rows();
  28. $config['next_link'] = '&raquo;';
  29. $config['prev_link'] = '&laquo;';
  30. $config['first_link'] = '&laquo; Awal';
  31. $config['last_link'] = 'Akhir &raquo;';
  32. $this->pagination->initialize($config);
  33. $data['artikel'] = $this->artikel->tampil_artikel($config['per_page'], $this->uri->segment(3));
  34. $data['halaman'] = $this->pagination->create_links();
  35. $data['images'] = $this->crud->show('home');
  36. //$arr['artikel'] = $this->artikel->show('artikel');
  37. $data['page'] ='blog';
  38. //$this->load->view('head');
  39. $this->load->view('blog-style3', $data);
  40. //$this->load->view('foot');
  41. }
  42. }
  43.  
  44. /* End of file welcome.php */
  45. /* Location: ./application/controllers/welcome.php */
Advertisement
Add Comment
Please, Sign In to add comment