0
나는 '공급 업체'파일로 구현 한 큰 배열을 가지고 있습니다. 컨트롤러에서 파일을로드합니다.cakephp 모델에서 큰 목록 캐싱
App :: import ('Vendor', 'constants_helper');
이것은 잘 작동합니다.
그러나이 모델을 다른 모델에서 사용해야합니다. 모델 내에서 내가 가지고있다
App::import('Vendor', 'constants_helper');
class MyModel extends AppModel {
function afterFind($results) {
if (!isset($constantsHelper)) {
$constantsHelper = new ConstantsHelper();
}
$constantsHelper = new ConstantsHelper();
$list= $constantsHelper->mylist;
}
}
이것은 목록을로드하는 것 같다. 그러나 나는 2 개의 질문이있다
1. 이것은 목록을 적재하는 데 케이크 한 (오른쪽) 방법인가? 2.이 목록을 캐시하려면 어떻게해야합니까? 모든 모델에 대해 호출을 새로 고칩니다.
케이크에, 도우미는보기 확장이기 때문에 당신은 도우미를 호출해서는 안