Welcome Guest, Not a member yet? Register   Sign In
Controller problem : cannot load it's index automatically
#1

[eluser]anggie[/eluser]
Hi all...
I have search within the forum and didn't find answer, so i decided to ask you guys :
Here is my problem:

I have a controller named "Admin" and of course I give it an index() and _construct method.
Normally, if I call mysite.com/index.php/admin, it'll load index() method,right?

BUT IN MY ADMIN CONTROLLER NOT!

It ask me to add an index segment (mysite.com/index.php/admin/index) for real result.
I don't know where is my wrong, because i have another controller that act normally like.

Would you mind helping me? Thanks in advance.

sorry for my bad English.
#2

[eluser]Pascal Kriete[/eluser]
I have a hunch that we can work this out. Could you post the controller (reduced to the constructor and index functions)?
#3

[eluser]anggie[/eluser]
Sure...
Code:
<?php
class Admin extends Controller{
    function Admin(){
      parent::Controller();
      $this->load->plugin('captcha');
      $this->load->library('auth');
    }
    function index()
    {
      $this->template->write_view('nav','common/nav');
      $this->template->write_view('content','admin/menu');
      $this->template->write_view('sidebar','common/sidebar');
      $this->template->render();
    }
Thanks for fast reply...
#4

[eluser]Pascal Kriete[/eluser]
Hmm, I was afraid of this Tongue . I can't see anything right off the bat.

Does it show a page at all? 404, blank page, error message?
Have you extended any core classes, specifically the router?

ps. Just saw it's your first post, welcome to the forums.
#5

[eluser]anggie[/eluser]
Quote:specifically the router?
WoWWW!!!
Yeah...I just found the answer. The problem was in the routes.php.
I just remember that I did a small experiment in auth user...and I forget to delete that setting...Smile

Thanks!!!

Regards...
#6

[eluser]Pascal Kriete[/eluser]
Glad I could help Smile .




Theme © iAndrew 2016 - Forum software by © MyBB