Tuesday 18 August 2015

Simple Routing In Codeignter with example

Hi this is my short documentation about routing in codeignter

This is my router.php change as you needed
 /*router for front end artikel*/  
 $route['trend'] = 'welcome/trend';  
 $route['studikasus'] = 'welcome/studikasus';  
 $route['berita'] = 'welcome/berita';  

as you can see i just only one controller which is Welcome.php so here is my controller


and this is view welcome_mesagge.php
 load->view('welcome_message');  
  }  
 public function trend()  
  {  
  echo "studikasus";  
  }  
 public function studikasus()  
  {  
  echo "studikasus";  
  }  
 public function berita()  
  {  
  echo "berita";  
  }  
 }  

All you can need to understand is here


 $route['trend'] = 'welcome/trend'; //trend is calling from view then codeignter will direct to welcome/trend  
Thanks for visiting me,

3 comments:

  1. Bro bisa bantu solve problem ini ga? http://kask.us/h6cbg

    trims

    ReplyDelete
    Replies
    1. http://sidaurukfreddy.blogspot.com/2015/08/upload-multiple-images-using-codeignter.html silahkan

      Delete
  2. boleh sudah ku baca ntar agak sorean ane buat tutorial ya ?

    ReplyDelete