php - Routes not working in Codeigniter -
i'm using codeigniter 1.9 build website.
i want http://myurl.com/index.php/user/profile/2 take me profile page user id of 2.
my routes.php file looks this.
$route['default_controller'] = 'welcome'; $route['404_override'] = ''; $route['user/profile/(:num)'] = 'user/profile_view/$1';
my user.php file looks this.
class user extends ci_controller { function __construct() { parent::__construct(); $this->load->model('user_model'); } function profile_view($id) { $data = array(); log_message("info", "i in profile_view method of user.php."); $this->load->view("templates/header", $data); $this->load->view("templates/footer", $data); } }
the code never making log_message() function , throwing 500 error says this...
http error 500 (internal server error): unexpected condition encountered while server attempting fulfil request.
any appreciated. i've been looking several hours no luck.
the $data pass not initialize. error 500 comes it. before log_message, type statement:
$data = array();
tell if have error after correction.
Comments
Post a Comment