Skip to content

Instantly share code, notes, and snippets.

@juizmill
Last active December 24, 2015 03:29
Show Gist options
  • Save juizmill/6737354 to your computer and use it in GitHub Desktop.
Save juizmill/6737354 to your computer and use it in GitHub Desktop.
Exemplo de como recuperar dados de configuração direto do global.php ou local.php
public function getServiceConfig()
{
return array(
'factories' => array(
'Contato\Mail\Transport' => function($sm) {
$config = $sm->get('Config');
$transport = new SmtpTransport;
$options = new SmtpOptions($config['mail']);
$transport->setOptions($options);
return $transport;
},
'Contato\Service\Contato' => function($sm) {
return new Service\Contato($sm->get('Contato\Mail\Transport'),$sm->get('View'));
}
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment