Commit e2b3530c authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading

Module.php

0 → 100755
+51 −0
Changes for Module.php: 51 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Exemple;

use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Zend\Http\Request as HttpRequest;
use Zend\Session\SessionManager;

class Module
{
    public function onBootstrap(MvcEvent $e)
    {
        $application = $e->getApplication();
        $serviceManager = $application->getServiceManager();
        $serviceManager->get('translator');
        $eventManager = $application->getEventManager();
        $moduleRouteListener = new ModuleRouteListener();
        $moduleRouteListener->attach($eventManager);

        /* Active un layout spécial si la requête est de type AJAX. Valable pour TOUS les modules de l'application. */
        $eventManager->getSharedManager()->attach('Zend\Mvc\Controller\AbstractActionController', 'dispatch',
            function (MvcEvent $e) {
                $request = $e->getRequest();
                if ($request instanceof HttpRequest && $request->isXmlHttpRequest()) {
                    $e->getTarget()->layout('layout/ajax.phtml');
                }
            }
        );

        // The following line instantiates the SessionManager and automatically
        // makes the SessionManager the 'default' one.
//        $serviceManager->get(SessionManager::class);
    }

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

    public function getAutoloaderConfig()
    {
        return [
            'Zend\Loader\StandardAutoloader' => [
                'namespaces' => [
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ],
            ],
        ];
    }
}
+117 −0
Changes for config/module.config.php: 117 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Exemple;

use Exemple\Controller\ContactController;
use Exemple\Controller\IndexController;

return [
    'bjyauthorize'    => [
        'guards'                => [
            'BjyAuthorize\Guard\Controller'         => [
                ['controller' => IndexController::class, 'roles' => 'guest'],
                ['controller' => ContactController::class, 'roles' => 'guest'],
            ],
        ],
    ],

    'router'          => [
        'routes' => [
            'exemple' => [
                'type'    => 'Literal',
                'options' => [
                    'route'    => '/exemple',
                    'defaults' => [
                        'controller' => IndexController::class,
                        'action'     => 'index',
                    ],
                ],
                'may_terminate' => true,
                'child_routes'  => [
                    'contact' => [
                        'type'          => 'Literal',
                        'options'       => [
                            'route'    => '/contact',
                            'defaults' => [
                                'controller' => ContactController::class,
                                'action' => 'index',
                            ],
                        ],
                        'may_terminate' => true,
                        'child_routes'  => [
                            'default' => [
                                'type'    => 'Segment',
                                'options' => [
                                    'route'       => '/:action',
                                    'constraints' => [
                                        /**
                                         * @see ContactController::ajouterAction()
                                         * @see ContactController::ajouterIdentiteAction()
                                         * @see ContactController::ajouterAdresseAction()
                                         * @see ContactController::ajouterMessageAction()
                                         * @see ContactController::ajouterAnnulerAction()
                                         * @see ContactController::ajouterConfirmerAction()
                                         * @see ContactController::ajouterEnregistrerAction()
                                         */
                                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'navigation'      => [
        'default' => [
            'home' => [
                'pages' => [
                    'exemple' => [
                        'label'    => 'Exemple',
                        'route'    => 'exemple',
                        'icon'     => 'glyphicon glyphicon-cog',
                        'pages' => [
                            'contact' => [
                                'label' => 'Formulaire multipage',
                                'route' => 'exemple/contact/default',
                                'action' => 'ajouter'
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'service_manager' => [
        'factories' => [

        ],
    ],

    'translator'      => [
        'locale'                    => 'fr_FR', // en_US
        'translation_file_patterns' => [
            [
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
            ],
        ],
    ],

    'controllers'     => [
        'invokables' => [
            IndexController::class => IndexController::class,
            ContactController::class => ContactController::class,
        ],
    ],

    'view_manager'    => [
        'template_path_stack' => [
            __DIR__ . '/../view',
        ],
    ],
];

language/en_US.mo

0 → 100755
+545 B

File added.

No diff preview for this file type.

language/en_US.po

0 → 100755
+154 −0
Changes for language/en_US.po: 154 added lines, 0 removed lines.
Original line number Diff line number Diff line
msgid ""
msgstr ""
"Project-Id-Version: ZendSkeletonApplication\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-07-05 22:17-0700\n"
"PO-Revision-Date: 2013-04-08 08:49+0100\n"
"Last-Translator: nommerci <nomerci@hotmail.fr>\n"
"Language-Team: ZF Contibutors <zf-devteam@zend.com>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: translate\n"
"X-Poedit-Language: English\n"
"X-Poedit-Country: UNITED STATES\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ..\n"

#: ../view/layout/layout.phtml:6
#: ../view/layout/layout.phtml:33
#, fuzzy
msgid "Skeleton Application"
msgstr ""

#: ../view/layout/layout.phtml:36
msgid "Home"
msgstr ""

#: ../view/layout/layout.phtml:50
msgid "All rights reserved."
msgstr ""

#: ../view/application/index/index.phtml:2
#, php-format
msgid "Welcome to %sZend Framework 2%s"
msgstr ""

#: ../view/application/index/index.phtml:3
#, php-format
msgid "Congratulations! You have successfully installed the %sZF2 Skeleton Application%s. You are currently running Zend Framework version %s. This skeleton can serve as a simple starting point for you to begin building your application on ZF2."
msgstr ""

#: ../view/application/index/index.phtml:4
msgid "Fork Zend Framework 2 on GitHub"
msgstr ""

#: ../view/application/index/index.phtml:10
msgid "Follow Development"
msgstr ""

#: ../view/application/index/index.phtml:11
#, php-format
msgid "Zend Framework 2 is under active development. If you are interested in following the development of ZF2, there is a special ZF2 portal on the official Zend Framework website which provides links to the ZF2 %swiki%s, %sdev blog%s, %sissue tracker%s, and much more. This is a great resource for staying up to date with the latest developments!"
msgstr ""

#: ../view/application/index/index.phtml:12
msgid "ZF2 Development Portal"
msgstr ""

#: ../view/application/index/index.phtml:16
msgid "Discover Modules"
msgstr ""

#: ../view/application/index/index.phtml:17
#, php-format
msgid "The community is working on developing a community site to serve as a repository and gallery for ZF2 modules. The project is available %son GitHub%s. The site is currently live and currently contains a list of some of the modules already available for ZF2."
msgstr ""

#: ../view/application/index/index.phtml:18
msgid "Explore ZF2 Modules"
msgstr ""

#: ../view/application/index/index.phtml:22
msgid "Help &amp; Support"
msgstr ""

#: ../view/application/index/index.phtml:23
#, php-format
msgid "If you need any help or support while developing with ZF2, you may reach us via IRC: %s#zftalk on Freenode%s. We'd love to hear any questions or feedback you may have regarding the beta releases. Alternatively, you may subscribe and post questions to the %smailing lists%s."
msgstr ""

#: ../view/application/index/index.phtml:24
msgid "Ping us on IRC"
msgstr ""

#: ../view/error/index.phtml:1
msgid "An error occurred"
msgstr ""

#: ../view/error/index.phtml:8
msgid "Additional information"
msgstr ""

#: ../view/error/index.phtml:11
#: ../view/error/index.phtml:35
msgid "File"
msgstr ""

#: ../view/error/index.phtml:15
#: ../view/error/index.phtml:39
msgid "Message"
msgstr ""

#: ../view/error/index.phtml:19
#: ../view/error/index.phtml:43
#: ../view/error/404.phtml:55
msgid "Stack trace"
msgstr ""

#: ../view/error/index.phtml:29
msgid "Previous exceptions"
msgstr ""

#: ../view/error/index.phtml:58
msgid "No Exception available"
msgstr ""

#: ../view/error/404.phtml:1
msgid "A 404 error occurred"
msgstr ""

#: ../view/error/404.phtml:10
msgid "The requested controller was unable to dispatch the request."
msgstr ""

#: ../view/error/404.phtml:13
msgid "The requested controller could not be mapped to an existing controller class."
msgstr ""

#: ../view/error/404.phtml:16
msgid "The requested controller was not dispatchable."
msgstr ""

#: ../view/error/404.phtml:19
msgid "The requested URL could not be matched by routing."
msgstr ""

#: ../view/error/404.phtml:22
msgid "We cannot determine at this time why a 404 was generated."
msgstr ""

#: ../view/error/404.phtml:34
msgid "Controller"
msgstr ""

#: ../view/error/404.phtml:41
#, php-format
msgid "resolves to %s"
msgstr ""

#: ../view/error/404.phtml:51
msgid "Exception"
msgstr ""

language/fr_FR.mo

0 → 100755
+4.95 KiB

File added.

No diff preview for this file type.

Loading