Created
October 2, 2012 11:09
-
-
Save anonymous/3818227 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// module/Album/Module.php | |
namespace Album; | |
use Album\Model\AlbumTable; | |
use Zend\Mvc\ModuleRouteListener; | |
class Module | |
{ | |
public function onBootstrap($e) | |
{ | |
$application = $e->getApplication(); | |
$eventManager = $application->getEventManager(); | |
$eventManager->attach('route', function(){ | |
}, -1000); | |
// $translator = $e->getApplication()->getServiceManager()->get('translator'); | |
// $translator->setLocale('en_US')->setFallbackLocale('pt_BR'); | |
} | |
public function getAutoloaderConfig() | |
{ | |
return array( | |
'Zend\Loader\ClassMapAutoloader' => array( | |
__DIR__ . '/autoload_classmap.php', | |
), | |
'Zend\Loader\StandardAutoloader' => array( | |
'namespaces' => array( | |
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, | |
), | |
), | |
); | |
} | |
public function getConfig() | |
{ | |
return include __DIR__ . '/config/module.config.php'; | |
} | |
public function getServiceConfig() | |
{ | |
return array( | |
'factories' => array( | |
'Album\Model\AlbumTable' => function($sm) { | |
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter'); | |
$table = new AlbumTable($dbAdapter); | |
return $table; | |
}, | |
), | |
); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment