CodeIgniter Forums
_remap() ignored - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: _remap() ignored (/showthread.php?tid=75611)



_remap() ignored - Knutsford - 02-26-2020

Code:
<?php

class Pages extends Front_Controller {

function __construct()
{
parent::__construct();

$this->load->module('web/pages', 'pages');
}
function index()
{
echo "MMM";
}
// Captures all calls to this controller
    public function _remap()
    {
  echo "PPP";
die();
//print_r($this->_data);

    // Create a string of your template content
        $string = $this->template
            ->set_theme('web')
->set_template($this->template_array['template_file'])
->build('pages/index', $this->_data, false);

// Call a parser function to handle the tags and then spit it back to $parsed
        $parsed = $this->simpletags->parse($string, $this->_data);

        // Throw all the parser content back to the template (view)
        $this->output->set_output($parsed['content']);
    }
}



I am upgrading from 2.2.2 to 3.1.6

I added

function index()
Code:
{
Code:
echo "MMM";
Code:
}

as it complained that there wasn't one

It goes into index()

but

public function _remap() is being ignored and I have no idea
why as I haven't come across remap before. I was obviously
working before as that is where it should be going to.
Thanks



RE: _remap() ignored - InsiteFX - 02-26-2020

CodeIgniter 3 User Guide -> Remapping Method Calls