Welcome Guest, Not a member yet? Register   Sign In
File and class names
#1

Hi all,

I have a question (actually more than one, but let's start with this...) about the nomenclature of files and classes in CI4.

Controllers, docs give two version with and without "Controller" termination:

PHP Code:
// Case 1
//https://codeigniter4.github.io/userguide/incoming/controllers.html
class Name extends Controller {} // Using Name.php

// Case 2
//https://codeigniter4.github.io/userguide/libraries/pagination.html
class NameController extends Controller {} // Using NameController.php 

It is the same, or just a doc error?


For the model I can see only the "NameModel" version using NameModel.php

For the entity only the "Name" version:
PHP Code:
// https://codeigniter4.github.io/userguide/models/entities.html
class Name extends Entity {} // Using Name.php 

I can use all like this:
- NameController extends...
- NameModel extends...
- NameEntity extends...
without problems?


Thank you!
Reply


Messages In This Thread
File and class names - by Waithere - 12-26-2019, 04:21 AM
RE: File and class names - by kilishan - 12-26-2019, 09:18 PM
RE: File and class names - by InsiteFX - 12-27-2019, 08:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB