Skip to content

Instantly share code, notes, and snippets.

@Hounddog
Created October 15, 2012 19:32
Show Gist options
  • Save Hounddog/3894704 to your computer and use it in GitHub Desktop.
Save Hounddog/3894704 to your computer and use it in GitHub Desktop.
Abstract Module for configs
<?php
namespace Kernel\Module;
use ZfcCrudRest\Module\AbstractModule as ZfcCrudAbstractModule;
abstract class AbstractModule extends ZfcCrudAbstractModule
{
public function getConfig()
{
$config = include $this->getDir() . '/config/module.config.php';
$config = array_merge($config, $this->getViewConfig());
return $config;
}
public function getViewConfig()
{
return array(
'view_manager' => array(
'template_path_stack' => array(
$this->getDir() . '/../view',
),
),
);
}
public function getDir()
{
return $this->dir;
}
public function getNamespace()
{
return $this->namespace;
}
}
namespace MyModule
use Kernel\Module\AbstractModule
class Module extends AbstractModule
{
protected $namspace = __NAMESPAC__;
protected $dir = __DIR__;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment