Coder Social home page Coder Social logo

zendskeletonmodule's Introduction

Zend Framework Skeleton Module

Repository abandoned 2019-12-05

This repository is no longer maintained.

This is a sample skeleton module for use with zend-mvc applications.

Installation

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

Clone this repository into your application:

$ 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:

$ rm -Rf .git .gitignore

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

$ 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.

find and sed

You can also do this with the Unix utilties find and sed:

$ 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:

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

When done adding the entry:

$ composer dump-autoload

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

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:

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.