views:

64

answers:

0

Hi. I'm trying to pass through a CI tutorial (writing a simple forum) and I can't make a controller function called. To be more specific I have this in a controller:

function  __construct() {
        parent::Controller();
                $this->load->helper('url');
    }

    function index() {
            $data['title'] = "Wlcome to Gossip";
            $data['heading'] = "Welcome to Gossip";
            $data['query'] = $this->db->get('topic')->result();
            $this->load->view('welcome', $data);
    }

        function topic() {
            echo 'testing...';
        }

and when I'm trying to access the /index.php/forum/topic/ uri (Forum is the name of my controller class) it just prints out my index() function. Can any one point out what may cause the problem?

EDITED:
Defining next in a controller:

function _remap($method){
            if ($method == 'topic'){
                $this->topic();
            } else if ($method == 'index'){
                $this->index();
            }
        }

results in only index method name passed. If tested for other controller names result remains the same.

EDITED:
Well, I get a very strange error: If routes are not set (some default value is not assigned) like this:

$route['default_controller'] = "";
$route['scaffolding_trigger'] = "";

I can’t get to any controller (I’ve created another one for testing). So this looks like I can only get to some predefined controller index method. Is it possible that some php installation module/param/etc was not defined or alike?