Comments: $components, $helpers and $uses
2 - I have problem about $uses
Hi ,
I cannot use $uses variable in many elements,more than one element. And these are my codes.
class ShopsController extends AppController {
var $view="Theme";
var $name = 'Shops';
var $uses = array("shop","product");
function index() {
$this->loadTheme();
$this->loadMenus();
$this->set('shops', $this->shop->findAll());
}
}
Then , when I run these codes by web browser , I get These msg:
Missing Database Table
Error: Database table sbp_products for model product was not found.
I placed the file shops_controller.php in folder /app/controllers/ already and I have database table "sbp_products" already too.
Who can tell me how can I fix these problem?Thnks for your help?
Regards
PS. I use cakePHP 1.2 version
3 - I have problem about $uses
Hi ,
I cannot use $uses variable in many elements of array. And these are my codes.
class ShopsController extends AppController {
var $view='Theme';
var $name = 'Shops';
var $uses = array('shop','product');
function index() {
$this->loadTheme();
$this->loadMenus();
$this->set('shops', $this->shop->findAll());
}
}
Then , when I run these codes by web browser , I get These msg:
Missing Database Table
Error: Database table sbp_products for model product was not found.
I placed the file shops_controller.php in folder /app/controllers/ already and I have database table 'sbp_products' already too.
Who can tell me how can I fix these problem?Thnks for your help?
Regards
PS. I use cakePHP 1.2 version

By silverquick on 16/6/08
1 - Can't you leave out HtmlHelper, SessionComponent?
Since HtmlHelper and SessionComponent are available by default, I can't you just do e.g. var $components = array('Email'); and still have access to $this->Session? In 1.2.0.7125-rc1 at least, this is true. So isn't this a bit misleading/confusing? I'm not sure so I didn't edit it.