0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

$usesは1度使用しないとmodelから定数を呼び出せない

Posted at

詳しくは調べていないので自分用メモ

public $uses = array(
    'Hoge',
);

$this->Hoge->find();

$fuga = Hoge::fuga;

上記はOK

public $uses = array(
    'Hoge',
);

$fuga = Hoge::fuga;

この場合はエラー

App::uses('Hoge', 'Model');

$fuga = Hoge::fuga;

これもOK

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?