3

When trying to figure out how to do something the core does programmatically, a good place to start is the core itself. In particular, you want to look at Craft's controllers which handle all interactions with the UI and Craft's services which provide a lot of methods for common tasks. In this case, you're looking for craft\controllers\SectionsController::...


2

Class 'modules\importGeoJson\BaseJob' not found You're getting this error because you're trying to extend the craft\queue\BaseJob, but you're not importing (aliasing) that class. In general, a simple class identifier will be assumed to belong to the current namespace. So since your class is namespaced to modules\jobs, the BaseJob class identifier resolves ...


1

For anyone strugglng with this. I split the process into a service and a job. It seems you also have to register your job/services classes in main plugin file first: $this->setComponents([ 'Importgeojson' => Importgeojson::class, // job 'MapitapiService' => MapitapiService::class // service ]); then call the service ...


Only top voted, non community-wiki answers of a minimum length are eligible