Open PauchardThomas opened 2 years ago
and I cannot use DependencyInjection
Why not? Missing autoconfiguration/autowiring?
When I'm trying to inject Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager
, here what's i'm getting :
Cannot autowire argument $manager of "App\Controller\MyController::myfunction()": it references class "Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager" but no such service exists. You should maybe alias this class to the existing "oneup_uploader.orphanage_manager" service.
Here my conf :
# Read the documentation: https://github.com/1up-lab/OneupUploaderBundle/blob/master/Resources/doc/index.md
oneup_uploader:
mappings:
# This is a mapping example, remove it and create your own mappings.
gallery:
#use_orphanage: true
frontend: dropzone # or any uploader you use in the frontend
storage:
directory: "%kernel.project_dir%/public/uploads/gallery/"
use_orphanage: true
chunks:
maxage: 86400 # 24h
storage:
directory: "%kernel.cache_dir%/uploader/chunks"
orphanage:
maxage: 86400 # 24h
directory: "%kernel.cache_dir%/uploader/orphanage"
Should I add something to my services.yaml ?
Thanks for the feedback, I'll try to provide a fix! 👍
Should I add something to my services.yaml ?
As a temporary fix you could add following to your services.yaml
:
# config/services.yaml
services:
# ...
# Alias
Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager: "@oneup_uploader.orphanage_manager"
# ...
Question
Hello, following the controller part from orphanage doc, i'm trying to acces to the OrphanageManager :
$manager = $this->get('oneup_uploader.orphanage_manager')->get('gallery');
However,
$this->get('')
not existing on AbstractController on Symfony6, and I cannot use DependencyInjection withOneup\UploaderBundle\Uploader\Orphanage\OrphanageManager
How can I call the manager with S6 ?
Thnaks