Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added Module class and configuration

  • Loading branch information...
commit efee110ea78a359baeb9af2b1a169a1dcd8800a5 1 parent c1c0fc8
@weierophinney authored
Showing with 77 additions and 0 deletions.
  1. +11 −0 Module.php
  2. +66 −0 config/module.config.php
View
11 Module.php
@@ -0,0 +1,11 @@
+<?php
+
+namespace PhlyPeep;
+
+class Module
+{
+ public function getConfig()
+ {
+ return include __DIR__ . '/config/module.config.php';
+ }
+}
View
66 config/module.config.php
@@ -0,0 +1,66 @@
+<?php
+return array(
+ 'phly_peep' => array(
+ 'db' => array(
+ 'adapter' => 'Zend\Db\Adapter\Adapter',
+ 'table' => 'peep',
+ ),
+ ),
+ 'router' => array(
+ 'routes' => array(
+ 'peep' => array(
+ 'type' => 'Literal',
+ 'options' => array(
+ 'route' => '/peep',
+ 'defaults' => array(
+ 'controller' => 'phly-peep',
+ 'action' => 'index',
+ ),
+ ),
+ 'may_terminate' => true,
+ 'child_routes' => array(
+ 'submit' => array(
+ 'type' => 'Literal',
+ 'options' => array(
+ 'route' => '/process',
+ 'defaults' => array(
+ 'action' => 'submit',
+ ),
+ ),
+ ),
+ // by user
+ 'user' => array(
+ 'type' => 'Segment',
+ 'options' => array(
+ 'route' => '/user/:username',
+ 'constraints' => array(
+ 'username' => '[a-zA-Z0-9_]+',
+ ),
+ 'defaults' => array(
+ 'action' => 'username',
+ ),
+ ),
+ ),
+ // by id
+ 'status' => array(
+ 'type' => 'Segment',
+ 'options' => array(
+ 'route' => '/status/:identifier',
+ 'constraints' => array(
+ 'identifier' => '[a-zA-Z][0-9]{8}',
+ ),
+ 'defaults' => array(
+ 'action' => 'status',
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'controller' => array(
+ 'classes' => array(
+ 'phly-peep' => 'PhlyPeep\Controller\PeepController',
+ ),
+ ),
+);
Please sign in to comment.
Something went wrong with that request. Please try again.