Welcome Guest, Not a member yet? Register   Sign In
CI controller function is ignored
#1

[eluser]den-javamaniac[/eluser]
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:

Code:
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 contents of index() function. Defining next in a controller:

Code:
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. Can any one point out what may cause the problem?

NOTE: this issue is also discussed here.


Messages In This Thread
CI controller function is ignored - by El Forum - 05-09-2010, 04:15 AM
CI controller function is ignored - by El Forum - 05-09-2010, 05:16 AM
CI controller function is ignored - by El Forum - 05-09-2010, 05:21 AM
CI controller function is ignored - by El Forum - 05-09-2010, 05:29 AM
CI controller function is ignored - by El Forum - 05-09-2010, 05:35 AM
CI controller function is ignored - by El Forum - 05-09-2010, 05:43 AM
CI controller function is ignored - by El Forum - 05-09-2010, 05:59 AM
CI controller function is ignored - by El Forum - 05-09-2010, 06:05 AM
CI controller function is ignored - by El Forum - 05-09-2010, 06:11 AM
CI controller function is ignored - by El Forum - 05-09-2010, 06:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB