Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jmdeldin/php_mvc
Simple MVC framework in PHP
https://github.com/jmdeldin/php_mvc
Last synced: about 1 month ago
JSON representation
Simple MVC framework in PHP
- Host: GitHub
- URL: https://github.com/jmdeldin/php_mvc
- Owner: jmdeldin
- Created: 2009-10-31T09:12:25.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2009-10-31T09:12:43.000Z (about 15 years ago)
- Last Synced: 2023-04-13T07:51:08.391Z (over 1 year ago)
- Homepage:
- Size: 85.9 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
Really Simple PHP MVC
=====================This is an example of a really simple PHP application that implements the
Model-View-Controller pattern [1]. It's meant to be instructive, which is why
it doesn't implement features like ORM or authentication found in popular
frameworks.Overview
--------To understand this project, open "pub/index.php". This file configures the
basic constants like `ROOT` and APP_PATH`. It then calls "app/bootstrap.php",
which configures the autoloading of our classes. Finally, we start the
application by calling the `delegate` method of "app/classes/Router.php". The
routing performed in `Router` is the core of this framework. It is responsible
for mapping URIs like
to the appropriate controller. Aside from this class, everything else can be
modified/discarded. The codebase is tiny (~264K with examples), so it should
be easy enough to grasp. Feel free to contact me with any question [2].Note: The .htaccess file is _not_ required, but it is used in the examples. If
you'd rather not use it, use `/index.php?route=` instead.Filesystem
----------|-- app => site root (not web-root)
| |-- classes => non-(model|controller) classes
| |-- controllers => controller (FooController.php)
| |-- models => model classes (FooModel.php)
| `-- views => simple templating files
`-- pub => web rootLinks
-----[1]
[2]