I have an existing site in Joomla. and I want a new application in CakePHP, but with the same existing Joomla database.
Joomla
CakePHP
So here is the problem with the name of the tables. Please suggest me to use this table (for example market_type, listing_typein the singular form) in CakePHP, because the standard CakePHPwe use the table in the plural.
market_type
listing_type
You can define the table name in the model
class Example extends AppModel { public $useTable = 'exmp'; // This model uses a database table 'exmp' }
Use Table Cakephp
You can also add custom rules to the inflector. This way the baker will also understand your table names.
// somewhere in your bootstrap.php Inflector::rules('plural', array('irregular' => array('singular' => 'plural')));
Inflector classify() tableize(), , Cake / . :
$model = Inflector::classify('market_type');
MarketType
.
, :
Inflector::tableize('MarketType');
market_types
Inflector CakePHP, . : CakePHP 2.x: Inflector
Cake, .
( ):
cakePhp , .