strpos codeigniter php 7 1

strpos codeigniter php 7

//  Edit file application/third_party/MX/Router.php

public function set_class($class) {
  $suffix = $this->config->item('controller_suffix');
  if ($suffix && strpos($class, $suffix) === FALSE) {
    $class .= $suffix;
  }
  parent::set_class($class);
} 

Here is what the above code is Doing:
1. It’s loading the config file.
2. It’s checking if the config file has a controller suffix.
3. If it does, it’s appending the suffix to the class name.
4. It’s calling the parent method to set the class.

Now, you can add the suffix to the config file.

// Edit file application/config/config.php

$config[‘controller_suffix’] = ‘_controller’;

Similar Posts