Jump to content

Edit History

sococa

sococa


solved

Prestashop 8.1.1
PHP 8.1.29

Hi everyone,

I'm trying to create a module, but for a reason that i don't understand, the call to my service in my controller don't work. :

$sendCodeService = ServiceLocator::get('lebrun.lebruntwofa.sendcodeservice'); //C'EST ICI QUE CA MERDE

When i directly call the url https://prestashop.local/module/lebruntwofa/sendcode in the browser, i receive this error :Capturedcrandu2024-08-1209-54-55.thumb.png.916ccf7b4e8ae1b77973ace5e1b50c47.png

However, the service is called with the same name that the services.yam name : 

services:
  _defaults:
    public: true

  lebrun.lebruntwofa.sendcodeservice:
    public: true
    class: Lebrun\Lebruntwofa\Services\SendcodeService


He's well declared : 

/var/www/prestashop$ sudo php bin/console debug:container lebrun.lebruntwofa.sendcodeservice

Information for Service "lebrun.lebruntwofa.sendcodeservice"
============================================================

 ---------------- --------------------------------------------- 
  Option           Value                                        
 ---------------- --------------------------------------------- 
  Service ID       lebrun.lebruntwofa.sendcodeservice           
  Class            Lebrun\Lebruntwofa\Services\SendcodeService  
  Tags             -                                            
  Public           yes                                          
  Synthetic        no                                           
  Lazy             no                                           
  Shared           yes                                          
  Abstract         no                                           
  Autowired        yes                                          
  Autoconfigured   yes                                          
 ---------------- --------------------------------------------- 

I think the strucure files and names of files are good : 
Capturedcrandu2024-08-1210-07-11.png.c1a1e7c0169f688bd69a19efe8fa3c6e.png

So i have no idea of what's wrong, i hope someone can help me 🙏
I share you the entire module for a better comprehension.

Thank you !

lebruntwofa.zip

sococa

sococa

Prestashop 8.1.1
PHP 8.1.29

Hi everyone,

I'm trying to create a module, but for a reason that i don't understand, the call to my service in my controller don't work. :

$sendCodeService = ServiceLocator::get('lebrun.lebruntwofa.sendcodeservice'); //C'EST ICI QUE CA MERDE

When i directly call the url https://prestashop.local/module/lebruntwofa/sendcode in the browser, i receive this error :Capturedcrandu2024-08-1209-54-55.thumb.png.916ccf7b4e8ae1b77973ace5e1b50c47.png

However, the service is called with the same name that the services.yam name : 

services:
  _defaults:
    public: true

  lebrun.lebruntwofa.sendcodeservice:
    public: true
    class: Lebrun\Lebruntwofa\Services\SendcodeService


He's well declared : 

/var/www/prestashop$ sudo php bin/console debug:container lebrun.lebruntwofa.sendcodeservice

Information for Service "lebrun.lebruntwofa.sendcodeservice"
============================================================

 ---------------- --------------------------------------------- 
  Option           Value                                        
 ---------------- --------------------------------------------- 
  Service ID       lebrun.lebruntwofa.sendcodeservice           
  Class            Lebrun\Lebruntwofa\Services\SendcodeService  
  Tags             -                                            
  Public           yes                                          
  Synthetic        no                                           
  Lazy             no                                           
  Shared           yes                                          
  Abstract         no                                           
  Autowired        yes                                          
  Autoconfigured   yes                                          
 ---------------- --------------------------------------------- 

I think the strucure files and names of files are good : 
Capturedcrandu2024-08-1210-07-11.png.c1a1e7c0169f688bd69a19efe8fa3c6e.png

So i have no idea of what's wrong, i hope someone can help me 🙏
I share you the entire module for a better comprehension.

Thank you !

lebruntwofa.zip

sococa

sococa

Hi everyone,

I'm trying to create a module, but for a reason that i don't understand, the call to my service in my controller don't work. :

$sendCodeService = ServiceLocator::get('lebrun.lebruntwofa.sendcodeservice'); //C'EST ICI QUE CA MERDE

When i directly call the url https://prestashop.local/module/lebruntwofa/sendcode in the browser, i receive this error :Capturedcrandu2024-08-1209-54-55.thumb.png.916ccf7b4e8ae1b77973ace5e1b50c47.png

However, the service is called with the same name that the services.yam name : 

services:
  _defaults:
    public: true

  lebrun.lebruntwofa.sendcodeservice:
    public: true
    class: Lebrun\Lebruntwofa\Services\SendcodeService


He's well declared : 

/var/www/prestashop$ sudo php bin/console debug:container lebrun.lebruntwofa.sendcodeservice

Information for Service "lebrun.lebruntwofa.sendcodeservice"
============================================================

 ---------------- --------------------------------------------- 
  Option           Value                                        
 ---------------- --------------------------------------------- 
  Service ID       lebrun.lebruntwofa.sendcodeservice           
  Class            Lebrun\Lebruntwofa\Services\SendcodeService  
  Tags             -                                            
  Public           yes                                          
  Synthetic        no                                           
  Lazy             no                                           
  Shared           yes                                          
  Abstract         no                                           
  Autowired        yes                                          
  Autoconfigured   yes                                          
 ---------------- --------------------------------------------- 

I think the strucure files and names of files are good : 
Capturedcrandu2024-08-1210-07-11.png.c1a1e7c0169f688bd69a19efe8fa3c6e.png

So i have no idea of what's wrong, i hope someone can help me 🙏
I share you the entire module for a better comprehension.

Thank you !

lebruntwofa.zip

×
×
  • Create New...