2017 © Pedro Peláez
 

library base-module

no description

image

yogi721/base-module

no description

  • Thursday, March 2, 2017
  • by yogi721
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Zend Framework Skeleton Module

This is a sample skeleton module for use with zend-mvc applications., (*1)

Installation

First, decide on a namespace for your new module. For purposes of this README, we will use MyNewModule., (*2)

Clone this repository into your application:, (*3)

$ cd module
$ git clone https://github.com/zendframework/ZendSkeletonModule MyNewModule
$ cd MyNewModule

If you wish to version the new module with your application, and not as a separate project, remove the various Git artifacts within it:, (*4)

$ rm -Rf .git .gitignore

If you want to version it separately, remove the origin remote so you can specify a new one later:, (*5)

$ git remote remove origin

The next step will be to change the namespace in the various files. Open each of config/module.config.php, src/Module.php, and src/Controller/SkeletonController.php, and replace any occurence of ZendSkeletonModule with your new namespace., (*6)

find and sed

You can also do this with the Unix utilties find and sed:, (*7)

$ for php in $(find . -name '*.php');do
  > sed --in-place -e 's/ZendSkeletonModule/MyNewModule/g' $php
  > done
  

Next, we need to setup autoloading in your application. Open the composer.json file in your application root, and add an entry under the autoload.psr-4 key:, (*8)

"autoload": {
    "psr-4": {
        "MyNewModule\\": "module/MyNewModule/src/"
    }
}

When done adding the entry:, (*9)

$ composer dump-autoload

Finally, notify your application of the module. Open config/modules.config.php, and add it to the bottom of the list:, (*10)

return [
    /* ... */
    'MyNewModule',
]

application.config.php

If you are using an older version of the skeleton application, you may not have a modules.config.php file. If that is the case, open config/application.config.php instead, and add your module under the modules key:, (*11)

'modules' => [
      /* ... */
      'MyNewModule',
  ],
  

The Versions

02/03 2017

dev-master

9999999-dev

no description

  Sources   Download

MIT

by mane first