come funziona il DIC
<?php
$mailer = $this->get('mailer');
niente più sfContext!
come funziona il DIC
<?php
$mailer = $this->get('newsletter');
<?php
namespace AcmeMyBundle;
class Newsletter
{
protected $mailer;
public function __construct(Swift_Mailer $mailer)
{
$this->mailer = $mailer;
}
}
come funziona il DIC
<?php
namespace AcmeMyBundle;
use DoctrineORMEntityManager;
class Newsletter
{
protected $mailer, $em;
public function __construct(Swift_Mailer $mailer, EntityManager $em)
{
$this->mailer = $mailer;
$this->em = $em;
}
}