Welcome Guest, Not a member yet? Register   Sign In
404 Page Not Found The page you requested was not found...
#1

[eluser]Nidheesh[/eluser]
The page i requested was there and the other controllers are works fine....What's the problem...Is there any permanent solution

My Controller Code


Code:
<?
class Testimonials extends CI_Controller {
    function __construct()
    {
        parent::__construct();
        $this->load->model('testimonials_model', "", TRUE);
        
    }

   function Testimonials()
    {
        
      // $this->load->model('testimonials_model');
       $this->data['Page_Info']=$this->testimonials_model->get_menus();
       $this->load->view('testimonials.php', $this->data);
      //$this->load->view('Testimonials.php');
       echo  $this->data['Page_Info'];
      
       //print_r($this->data) ;
    }
}
?>

My Model Code

Code:
<?
class Testimonials_model extends CI_Model{
    public $id;
    public $menuname='';
    public $menulink='';
    
    function Testimonials()
    {
       parent::__construct();
    //   $this->load->database();    
    }
    
     function get_menus()
     {
        $this->db->select('*');
        $this->db->from('tbl_menus');
        $Page_Info=$this->db->get()->result();
        return $Page_Info;
        echo $Page_Info;
     }
}
?>


Error

Code:
http://localhost/samplesite/index.php/Testimonials


[code]
404 Page Not Found

The page you requested was not found.
[/code

#2

[eluser]micha8l[/eluser]
// $this->load->model('testimonials_model');

^ this
#3

[eluser]Nidheesh[/eluser]
That is commented ...i think no need of initializing the model again inside the function..
#4

[eluser]CroNiX[/eluser]
Take a look at your model construct.

It should be named __construct(), or at least it should be named the same as your class name, which it isn't.
#5

[eluser]CroNiX[/eluser]
Also, the construct in your controller is wrong too, it only has one underscore.
#6

[eluser]Nidheesh[/eluser]
Now i have changed both constructor name and its contents

Code:
function __construct()
    {
        parent::__construct();
        $this->load->model('testimonials_model', "", TRUE);
        
    }

Now the error is like this

Code:
404 Page Not Found

The page you requested was not found.

#7

[eluser]pettersolberg[/eluser]
The problem is - you have two constructors (i.e. __construct() and the function you have listed).
Change the function name to something else than the class' name.
Should work now
#8

[eluser]Nidheesh[/eluser]
Ya man Now it works !!!!!!
Thanks for all




Theme © iAndrew 2016 - Forum software by © MyBB