Welcome Guest, Not a member yet? Register   Sign In
BaseController and controller documentation mismatch
#2

Both are correct. You can extend BaseController (or any other Controller using the same naming scheme), as long as you don't access it with an url.

http://localhost/helloworld won't find HelloWorld file, as it dosen't know what letter you have capitalized. Therefor it should be Helloworld.

HOWEVER as you may already have tested, it's working right?! That means you are using Windows. Windows dosen't care about CaPiTaLiZaTiOn, but you generally have a Linux server for production. And now your application are broken. As you don't have a Capitalization.

If you are like me, only using HelloWorld for my naming scheme on your files, you can define your files in the /app/Config/Routes.php
$routes->get('helloworld', 'HelloWorld::index');

Now CodeIgniter will find it again on Linux.

TLDR: It's because CodeIgniters auto-magic resolver (setAutoRoute) from url to controller.
Reply


Messages In This Thread
RE: BaseController and controller documentation mismatch - by jreklund - 04-17-2020, 02:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB