в моей базе данных, у меня есть таблицы, созданные некоторыми плагинами.Мне нужно показать только мои модели в раскрывающемся списке.
в bootstrap.php:
Configure::write('ReportManager.modelIgnoreList',array(
'acl_phinxlog',
'acos',
'aros',
'aros_acos',
'audits',
'burzum_file_storage_phinxlog',
'burzum_user_tools_phinxlog',
'cake_d_c_users_phinxlog',
'file_storage',
'phinxlog',
));
В моей функции индекса контроллера:
if (empty($this->data)) {
$modelIgnoreList = Configure::read('ReportManager.modelIgnoreList');
$models = ConnectionManager::get('default')->schemaCollection()->listTables();
foreach($models as $key => $model) {
if ( isset($modelIgnoreList) && is_array($modelIgnoreList)) {
foreach ($modelIgnoreList as $ignore) {
if (isset($models[$ignore])) {
unset($models[$ignore]);
$modelData = TableRegistry::get($model);
debug($modelData);
}
}
}
}
debug($modelIgnoreList);
}
В индексе.ctp:
echo $this->Form->create('ReportManager');
echo '<fieldset>';
echo '<legend>' . __d('report_manager','New report',true) . '</legend>';
echo $this->Form->input('model',array(
'type'=>'select',
'label'=>__d('report_manager','Model',true),
'options'=>$models,
'empty'=>__d('report_manager','--Select--',true)
));
Мой результат показывает все таблицы.Где моя ошибка?