php - Controller Not loading in CI -


i have 2 controllers in application/controllers

  1. welcome.php
  2. pages.php

i accessing welcome.php through url

http://opunletter.com/index.php/welcome/

but while accessing http://opunletter.com/index.php/pages/

i getting following error

404 page not found

the page requested not found.

i not able figure error. plz !

class pages extends controller {      function search($search_terms = '')     {         // if form has been submitted, rewrite url search         // terms can passed parameter action. note there         // issues characters here.         if ($this->input->post('q'))         {             redirect('/pages/search/' . $this->input->post('q'));         }          if ($search_terms)         {             // load model , perform search             $this->load->model('page_model');             $results = $this->page_model->search($search_terms);         }          // render view, passing necessary data         $this->load->view('search_results', array(             'search_terms' => $search_terms,             'results' => @$results         ));     } } 

try extends ci_controller , construct() following:

class pages extends ci_controller  {     function __construct()     {         parent::__construct();     }      function search($search_terms = '')     {         ...     } } 

and should use controller name pages.php (capital first letter) instead of pages.php in ci3.


Comments