Skip to content

Commit

Permalink
Merge branch 'hotfix/PathCorrections'
Browse files Browse the repository at this point in the history
  • Loading branch information
heiglandreas committed Feb 18, 2017
2 parents de8f0e2 + d9bb7b8 commit 1e0f9a5
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 57 deletions.
90 changes: 48 additions & 42 deletions config/module.config.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
<?php

namespace OrgHeiglContact;
namespace Org_Heigl\Contact;

return array(
'service_manager' => array(
'factories' => array(
'message' => 'OrgHeiglContact\Service\MailMessageFactory',
'transport' => 'OrgHeiglContact\Service\MailTransportFactory',
),
'invokables' => array(
'OrgHeiglContact\Form\ContactForm' => 'OrgHeiglContact\Form\ContactForm',
),
),
'controllers' => array(
'factories' => array(
'OrgHeiglContact\Controller\ContactController' => 'OrgHeiglContact\Service\ContactControllerFactory'
),
),
use Org_Heigl\Contact\Controller\ContactController;
use Org_Heigl\Contact\Form\ContactForm;
use Org_Heigl\Contact\Service\ContactControllerFactory;
use Org_Heigl\Contact\Service\MailMessageFactory;
use Org_Heigl\Contact\Service\MailTransportFactory;

return [
'service_manager' => [
'factories' => [
'message' => MailMessageFactory::class,
'transport' => MailTransportFactory::class,
],
'invokables' => [
ContactForm::class => ContactForm::class,
],
],
'controllers' => [
'factories' => [
ContactController::class => ContactControllerFactory::class,
],
],
'view_manager' => array(
'display_not_found_reason' => true,
'display_exceptions' => true,
Expand All @@ -28,39 +34,39 @@
__DIR__ . '/../view',
),
),
'router' => array(
'routes' => array(
'contact' => array(
'router' => [
'routes' => [
'contact' => [
'type' => 'Literal',
'options' => array(
'options' => [
'route' => '/contact',
'defaults' => array(
'controller' => 'OrgHeiglContact\Controller\ContactController',
'defaults' => [
'controller' => ContactController::class,
'action' => 'index',
),
),
],
],
'may_terminate' => true,
'child_routes' => array(
'process' => array(
'child_routes' => [
'process' => [
'type' => 'Literal',
'options' => array(
'options' => [
'route' => '/process',
'defaults' => array(
'defaults' => [
'action' => 'process',
),
),
),
'thank-you' => array(
],
],
],
'thank-you' => [
'type' => 'Literal',
'options' => array(
'options' => [
'route' => '/thank-you',
'defaults' => array(
'defaults' => [
'action' => 'thank-you',
),
),
),
),
),
),
)
);
],
],
],
],
],
],
]
];
2 changes: 1 addition & 1 deletion src/Controller/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function processAction()
'error' => true,
'form' => $form
));
$view->setTemplate('org-heigl-contact/contact/index');
$view->setTemplate('org_heigl/contact/contact/index');
return $view;
}

Expand Down
13 changes: 1 addition & 12 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,6 @@ public function onBootstrap(MvcEvent $event)

public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}

public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
return include __DIR__ . '/../config/module.config.php';
}
}
3 changes: 2 additions & 1 deletion src/Service/ContactControllerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

use Interop\Container\ContainerInterface;
use Org_Heigl\Contact\Controller\ContactController;
use Org_Heigl\Contact\Form\ContactForm;
use Zend\ServiceManager\Factory\FactoryInterface;


Expand Down Expand Up @@ -60,7 +61,7 @@ class ContactControllerFactory implements FactoryInterface
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$form = $container->get('OrgHeiglContact\Form\ContactForm');
$form = $container->get(ContactForm::class);
$message = $container->get('message');
$transport = $container->get('transport');

Expand Down
2 changes: 1 addition & 1 deletion src/Service/MailMessageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

class MailMessageFactory implements FactoryInterface
{
public function createService(ContainerInterface $container, $requestedName, array $options = null)
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$config = $container->get('config');
if ($config instanceof Traversable) {
Expand Down
File renamed without changes.

0 comments on commit 1e0f9a5

Please sign in to comment.