Welcome Guest, Not a member yet? Register   Sign In
"Json" as controller name does not work
#1

(This post was last modified: 10-27-2019, 01:44 PM by HarrysR.)

Well i've faced a very weird issue.

If i create a controller named "Json" and try to access it i get an "Object not found" error in my CI project. On the other hand if i give the controller another name it'll work like a charm or if i use an Uppercase first letter it will also work.

Here's my controller, filename and routes files.

Json.php
PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

class 
Json extends CI_Controller {
 public function 
index(){
   
// Some code
 
}


Routes.php
PHP Code:
$route['(?i)json']              'json';
$route['(?i)json/(:any)']       'json/$1'

Any ideas?

//Life motto
if (sad() == true) {
     sad().stop();
     develop();
}
Reply


Messages In This Thread
"Json" as controller name does not work - by HarrysR - 10-27-2019, 01:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB