I'm trying to create an import page as described in this documentation page https://octobercms.com/docs/backend/import-export For now i can not see the import page
the import export config file
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
The Part model
use Backend\Classes\Controller; use 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');
}
}
The file PartImport.php (made for now as in the documentation)
<?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());
}
}
}
}
The import.htm file is exactly as described in the documentation.
Maybe I'm missing something but I cant see the import or export buttons on the toolbar.