Closed Ddall closed 8 years ago
see pull request https://github.com/OwlyCode/EnseparHtml2pdfBundle/pull/25
hi i try to inject html2pdf_factory as service in one of my service class. i get same error :
Catchable Fatal Error: Argument 4 passed to EcommerceBundle\Controller\Services\PaymentService::__construct() must be an instance of HTML2PDF, none given
déclaration service
ecommerce_payment_service:
class: EcommerceBundle\Controller\Services\PaymentService
arguments:
- @doctrine.orm.default_entity_manager
- @ecommerce_order_service
- @messager.sender
- @html2pdf_factory
déclaration class service
use HTML2PDF;
use JMS\DiExtraBundle\Annotation as DI;
private $html2pdf;
..........
/**
* @DI\InjectParams({
* "em" = @DI\Inject("doctrine.orm.default_entity_manager"),
* "OrdersService" = @DI\Inject("ecommerce_order_service"),
* "MessagerMailer" = @DI\Inject("messager.sender"),
* "html2pdf" = @DI\Inject("html2pdf_factory"),
*
* })
*
* @param EntityManager $em
* @param OrdersService $OrdersService
* @param Messager $MessagerMailer
* @param HTML2PDF $html2pdf
*/
public function __construct( EntityManager $em, OrdersService $OrdersService, Messager $MessagerMailer, HTML2PDF $html2pdf )
{
$this->em = $em;
$this->OrdersService = $OrdersService;
$this->MessagerMailer = $MessagerMailer;
$this->html2pdf = $html2pdf;
}
........
Thank for help.
ok i deed
In readme.md, the service identifier is "html2pdf.factory", it should be "html2pdf_factory"