I am leaning cakePHP.
I noticed that a variable $name is declared in each Controller.
What is its purpose?
Is it referring to the name of table Sites?
<?php
class SitesController extends AppController {
var $name = 'Sites';
...
}
?>
If yes,
Can users refer to more than one table like this?
var $name = ‘Sites’, ‘Sites2’, ‘Sites3’;
It’s used for compatibility with PHP4. You can safely ignore it.
No, it;s not referring to the name of the table… It sometimes imply that controller named FooController will use model named Foo, but it’s not always true.
And no, you can’t specify model names like that. Models to be loaded are listed in
$usesproperty: