Home >Backend Development >PHP Tutorial >php framework - How does CodeIgniter's model correspond to a specific data table, similar to thinkphp's real_tableName?
Because I want to connect to a forum system. This system is made using CI. The user table of the original system is not called users, and it is impossible for me to rename the user table (in this case, the original system will have to be changed. At that time MVC is not very good), so I want to change this forum system, but the model name of codeigniter seems to be the corresponding table name, and there is no other way
Because I want to connect to a forum system. This system is made using CI. The user table of the original system is not called users, and it is impossible for me to rename the user table (in this case, the original system will have to be changed. At that time MVC is not very good), so I want to change this forum system, but the model name of codeigniter seems to be the corresponding table name, and there is no other way
CI’s model layer is very free, you can even operate all data tables in one model layer
It doesn’t matter what the class name of the model layer is. The key to what table you want to operate depends on how you write the code
for example
<code class="php">$this->db->select('title')->from('users')->get();</code>
is the operation users
table. The table prefix is configured in config/database.php