Browse files

Initial start of skeleton module

  • Loading branch information...
1 parent c915bfa commit 3e405e7217af3e5359242d6036715d1366205af7 @EvanDotPro EvanDotPro committed Sep 30, 2011
View
25 Module.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace ZendSkeletonModule;
+
+use Zend\Config\Config,
+ Zend\Module\Manager,
+ Zend\Loader\AutoloaderFactory;
+
+class Module
+{
+ public function init(Manager $moduleManager)
+ {
+ $this->initAutoloader();
+ }
+
+ public function initAutoloader()
+ {
+ include __DIR__ . '/autoload_register.php';
+ }
+
+ public function getConfig($env = null)
+ {
+ return new Config(include __DIR__ . '/configs/module.config.php');
+ }
+}
View
5 autoload_classmap.php
@@ -0,0 +1,5 @@
+<?php
+return array (
+ 'ZendSkeletonModule\\Module' => __DIR__ . DIRECTORY_SEPARATOR . 'Module.php',
+ 'ZendSkeletonModule\\Controller\\SkeletonController' => __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'ZendSkeletonModule' . DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'SkeletonController.php',
+);
View
12 autoload_function.php
@@ -0,0 +1,12 @@
+<?php
+return function ($class) {
+ static $map;
+ if (!$map) {
+ $map = include __DIR__ . '/autoload_classmap.php';
+ }
+
+ if (!isset($map[$class])) {
+ return false;
+ }
+ return include $map[$class];
+};
View
2 autoload_register.php
@@ -0,0 +1,2 @@
+<?php
+spl_autoload_register(include __DIR__ . '/autoload_function.php');
View
22 configs/module.config.php
@@ -0,0 +1,22 @@
+<?php
+return array(
+ 'di' => array(
+ 'instance' => array(
+ 'alias' => array(
+ 'skeleton' => 'ZendSkeletonModule\Controller\SkeletonController',
+ ),
+ 'Zend\View\PhpRenderer' => array(
+ 'methods' => array(
+ 'setResolver' => array(
+ 'resolver' => 'Zend\View\TemplatePathStack',
+ 'options' => array(
+ 'script_paths' => array(
+ 'skeleton' => __DIR__ . '/../views',
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+);
View
13 src/ZendSkeletonModule/Controller/SkeletonController.php
@@ -0,0 +1,13 @@
+<?php
+
+namespace ZendSkeletonModule\Controller;
+
+use Zend\Mvc\Controller\ActionController;
+
+class SkeletonController extends ActionController
+{
+ public function indexAction()
+ {
+ return array();
+ }
+}
View
3 views/skeleton/index.phtml
@@ -0,0 +1,3 @@
+<strong>Module:</strong> ZendSkeletonModule &raquo;
+<strong>Controller:</strong> Skeleton &raquo;
+<strong>Action:</strong> index

0 comments on commit 3e405e7

Please sign in to comment.