我尝试按照本文档页面https://octobercms.com/docs/backend/import-export中的说明创建导入页面 现在我看不到导入页面
导入导出配置文件
import:
title: Import z pliku xsl,xslx
modelClass: Depcore\Parts\Models\PartImport
list: $/depcore/parts/models/part/columns.yaml
redirect: depcore/parts/parts
export:
title: Eksport części
modelClass: Depcore\Parts\Models\PartImport
list: $/depcore/parts/models/part/columns.yaml
redirect: depcore/parts/parts
零件模型
使用Backend \ Classes \ Controller; 使用BackendMenu;
class Parts extends Controller
{
public $implement = ['Backend\Behaviors\ListController','Backend\Behaviors\FormController','Backend\Behaviors\ReorderController','Backend\Behaviors\ImportExportController'];
public $listConfig = 'config_list.yaml';
public $formConfig = 'config_form.yaml';
public $reorderConfig = 'config_reorder.yaml';
public $importExportConfig = 'config_import_export.yaml';
public function __construct()
{
parent::__construct();
BackendMenu::setContext('depcore.parts', 'parts', 'side-menu-item2');
}
}
文件PartImport.php(现在在文档中制作)
<?php
namespace depcore\parts\Models;
class PartImport extends \Backend\Models\ImportModel{
/**
* @var array The rules to be applied to the data.
*/
public $rules = [];
public function importData($results, $sessionKey = null) {
foreach ($results as $row => $data) {
try {
// $subscriber = new Subscriber;
// $subscriber->fill($data);
// $subscriber->save();
// $this->logCreated();
}
catch (\Exception $ex) {
$this->logError($row, $ex->getMessage());
}
}
}
}
import.htm文件与文档中描述的完全相同。
也许我错过了一些东西,但我看不到工具栏上的导入或导出按钮。