CakePHP: 2.3.5
class Table extends AppModel {
const STATUS_FREE = 0;
const STATUS_BUSY = 1;
const STATUS_INCHECK = 2;
const STATUS_LINK = 3;
const STATUS_CLEAN = 4;
const STATUS_CASHIER = 9;
我在TablesController中,我需要访问这个常量。我为此而创立的唯一方法是:
$this->loadModel('Table');
$free = Table::STATUS_FREE;
我也试试:
self::STATUS_FREE
$this->loadModel
如果我在 TablesController 中,为什么我需要使用?