Created
October 15, 2012 19:32
-
-
Save Hounddog/3894704 to your computer and use it in GitHub Desktop.
Abstract Module for configs
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 | |
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; | |
} | |
} |
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
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