Welcome Guest, Not a member yet? Register   Sign In
_remap second parameter ($params = array()) is empty?
#1

[eluser]vivid_haze[/eluser]
Hello guys. I have a problem. I have overriden CI's default call to method by using a '_remap' function. It all works as I should when I pass one parameter, which is of course the overriden method, (the second segment of the uri). However, following the user guide's instructions, when I try to retrieve additional segments of the url via the method below, the $params array is empty? I've used a var dump on the $a variable on my main_view, and it always shows the array is empty, even when the 3rd segment of the uri is present.

The CI user guide states 'Any extra segments after the method name are passed into _remap() as an optional second parameter.' (http://ellislab.com/codeigniter/user-gui...llers.html) But this doesn't appear to be so. Does anyone know what I might be doing wrong?


Code:
class Services extends Controller {
     var $group = 'services';
    function Services()
    {
        parent::Controller();
        $this->load->helper('url');
    }
    
    public function _remap($subPage, $params = array()){
        
        $pageData = $this->page_builder->buildPage($this->group,$subPage);
        if($subPage != 'index'){ $pageData['thisPage'] = $this->group .'/' . $subPage; }
        else{ $pageData['thisPage'] = $this->group; }
        $pageData['a'] = $params;
        $this->load->view('main_view', $pageData);
    }
}


Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB