Skip to content

Instantly share code, notes, and snippets.

Created October 2, 2012 11:09
Show Gist options
  • Save anonymous/3818227 to your computer and use it in GitHub Desktop.
Save anonymous/3818227 to your computer and use it in GitHub Desktop.
<?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