Git Product home page Git Product logo

php-mvc-structure's Introduction

php-mvc-structure

Info

Please note that this project is still a work-in-progress. There are a few bugs and code is sometimes really messy (e.g. autoloader script).

Description

This project allows you to have a simple MVC (Model, View, Controller) structure in PHP.

Classes and components

BootModule

The BootModule class is responsible for auto loading classes, starting sessions and URL routing. Application settings can be changed in the config.php file.

Controllers

Controllers are the main components of your application. They bind values to (view)models and render the view. Controllers inherit the base class ControllerBase. They are stored in the /controllers folder and should be named like this: [a-z]controller.php.

Models

Models are stored in the /models folder.

View models

View models are stored in the /viewmodels folder and should be named like this: [a-z]viewmodel.php.

Views

Views are basically what your users see and interact with. They contain HTML tags and JavaScript scripts. Views should not contain any business logic. They are stored in the /views folder and should have the extension .php. Images, CSS and scripts can be stored in /web.

Services

Services contain your website's business logic. Services are stored in the /services folder and should be named like this: [a-z]service.php

php-mvc-structure's People

Contributors

zwexlos avatar

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.