I have following Data:
Database name = ThisDatabase
Table name = InfoData
cakePHP3 convert the names in
ThisDatabase = this_database
InfoData = info_data
My problem is that I have no chance to rename the DB or Table names so I have to disable or bypass the name converting in cakePHP3. But I have no clue how I can do this.
How can i disable the converting? So I can use the actual names (ThisDatabase and InfoData).
You should follow naming convention for your files and cakephp to work properly, and specify the table name in initialize function inside your App\Model\Table\ArticlesTable.php
That's easy, CakePHP offers you a way to change the name of the table as you wish.
For the database, in the app config, set the database name :
...
'Datasources' => [
'default' => [
...
'username' => 'username',
'password' => 'password',
'database' => 'ThisDatabase', // Here you can set the database name
'encoding' => 'utf8',
..
]
],
...
Here is some doc
For the table name : In your table definition, change the table name
class Infodata extends Table
{
public function initialize(array $config)
{
$this->table('InfoData');
}
}
Here is is the doc