Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Commit

Permalink
Initial start of skeleton module
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDotPro committed Sep 30, 2011
1 parent c915bfa commit 3e405e7
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 0 deletions.
25 changes: 25 additions & 0 deletions 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');
}
}
5 changes: 5 additions & 0 deletions 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',
);
12 changes: 12 additions & 0 deletions 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];
};
2 changes: 2 additions & 0 deletions autoload_register.php
@@ -0,0 +1,2 @@
<?php
spl_autoload_register(include __DIR__ . '/autoload_function.php');
22 changes: 22 additions & 0 deletions 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',
),
),
),
),
),
),
),
);
13 changes: 13 additions & 0 deletions 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();
}
}
3 changes: 3 additions & 0 deletions 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.