This website uses Cookies to provide you with the best possible service. Please see our Privacy Policy for more information. Click the check box below to accept cookies. Then confirm with a click on "Save".  
Status: 2022-08-12

Directory Structure

root

├── application/
├── config/
├── modules/
├── public/
├── composer.json
├── myMVC.phar
└── README.md


application/

The application directory contains core code of myMVC Framework and also working directories like cache, log, session and templates_c.

application/
├── cache/
├── config/
├── doc/
├── library/
├── log/
├── session/
├── smartyPlugins/
├── templates_c/
├── vendor/
├── composer.json
└── composer.phar

  • cache/: place for caching files
  • config/: place for global config files
  • doc/: GNU GENERAL PUBLIC LICENSE
  • log/: logfile directory
  • session/: SessionIDs are stored here
  • smartyPlugins/: default smartyPlugin directory
  • templates_c/: home for compiled smarty templates
  • vendor/: third party libraries installed by composer
  • composer.json: list of third party libraries to install
  • composer.phar: a standalone composer script; no need to install composer

application/library/

This directory contains the core code of myMVC Framework inside the folder MVC.

application/library/
└── MVC/
    ├── DataType/
    │   ├── DTArrayObject.php
    │   ├── DTClass.php
    │   ├── DTConfig.php
    │   ├── DTConstant.php
    │   ├── DTKeyValue.php
    │   ├── DTProperty.php
    │   └── DTRoute.php
    ├── Generator/
    │   └── DataType.php
    ├── MVCInterface/
    │   ├── Controller.php
    │   ├── RouterJsonBuilder.php
    │   └── RouterJson.php
    ├── Application.php
    ├── Controller.php
    ├── Error.php
    ├── Event.php
    ├── File.php
    ├── Helper.php
    ├── Lock.php
    ├── Log.php
    ├── Minify.php
    ├── phan.list
    ├── Policy.php
    ├── Reflex.php
    ├── Registry.php
    ├── Request.php
    ├── RouterJsonBuilder.php
    ├── RouterJsonfile.php
    ├── RouterJson.php
    ├── Router.php
    ├── Session.php
    └── View.php

modules/{moduleName}/

In the modules folder you create your own module (here in this example it is the module Foo).
In your module you code your own application - You will find Model, View, Controller (MVC), but also some other directories.

modules/Foo/
├── Controller/
├── DataType/
├── etc/
├── Event/
├── Model/
├── Policy/
├── templates/
├── View/
├── generateDataTypes.php
├── install.sh
└── publish.sh

  • Controller/: folder to place your Controller
  • DataType/: place for generated datatype classes
  • etc/: place for install- and config files, docs, routing and individual other stuff
  • Event/: place for classes dealing with events. This is optional;
  • Model/: place for Model classes
  • Policy/: classes for Policy
  • templates/: smarty template files
  • View/: View classes
  • generateDataTypes.php: script to generate datatype classes, defined in modules/Foo/etc/config/DataType/*.php
  • install.sh: helper bash script to install files from modules/Foo/etc/_INSTALL/ to other places
  • publish.sh: helper bash script to copy files from modules/Foo/etc/_INSTALL/public/ to public/

example: complete extracted directory of a module Foo

modules/Foo/
├── Controller/
│   └── Index.php
├── DataType/
├── etc/
│   ├── config/
│   │   ├── DataType/
│   │   │   └── MODULE_DATATYPE.php
│   │   ├── Foo/
│   │   │   ├── config
│   │   │   │   └── develop.php
│   │   │   └── composer.json
│   │   ├── Cachix.php
│   │   ├── _init.php
│   │   ├── _MVC.php
│   │   └── policy.php
│   ├── doc/
│   ├── _INSTALL/
│   │   └── public/
│   │       └── robots.txt
│   └── routing/
│       ├── _createFinalJson.php
│       ├── final.json
│       └── frontend.json
├── Event/
│   └── Index.php
├── Model/
│   └── Index.php
├── Policy/
│   └── Index.php
├── templates/
│   └── Frontend/
│       ├── content/
│       │   ├── 404.tpl
│       │   ├── _cookieConsent.tpl
│       │   ├── index.tpl
│       │   └── _noscript.tpl
│       └── layout/
│           ├── footer.tpl
│           ├── header.tpl
│           ├── index.tpl
│           └── menu.tpl
├── View/
│   └── Index.php
├── generateDataTypes.php
├── install.sh
└── publish.sh

modules/{moduleName}/templates

templates directory structure of a module Foo

modules/Foo/templates/
└── Frontend
    ├── content
    │   ├── 404.tpl
    │   ├── _cookieConsent.tpl
    │   ├── index.tpl
    │   └── _noscript.tpl
    └── layout
        ├── footer.tpl
        ├── header.tpl
        ├── index.tpl
        └── menu.tpl
  • you may find further Information in Topic Frontend