Skip to content

a lightweight MVC-based PHP micro framework Inspired by Laravel.

License

Notifications You must be signed in to change notification settings

adnane-ka/mini-mvc

Repository files navigation

MINI MVC

This project was designed to build lightweight PHP applications based on the MVC architecture. It was inspired by Laravel to streamline development & provide easy use.

For a better saying, it's the lumen version for the lumen micro-framework.

Installation

  1. Download or clone the repository.
  2. Run composer install.
  3. Run touch .env to create an env file.
  4. Copy .env.example content to .env.
  5. Inject your mysql database credentials in .env file.
  6. Run php run db:migrate for database migration.
  7. Run php run dev to preview the project on your local webserver.

How to Use

If you intend to use this micro framework for a personal project, you can ignore the core directory unless you need to override existing functionality. All your application files should reside in the app directory, as you can use routes.php for route definition.

If you wish to contribute to this project, you are welcome to enhance or override the existing functionality in the core directory.

View managment

For view rendering, we've choosed Twig as a default template engine.

Project Structure

This project is organized into three primary components:

Core Components

The foundational components of this project include:

Implementation Overview

  1. All requests are routed through index.php as specified by the .htaccess file.
  2. The router handler class includes the target controller and invokes the corresponding method as defined in routes.php.
  3. The target controller interacts with models, leveraging the BaseModel class which utilizes a Query Builder to facilitate database interactions following an object-oriented paradiagm.
  4. The target controller renders the appropriate view.

Future Enhancements

  • Additional ORM implementations and Query Builder methods
  • More utility/helper methods
  • An exception handler for improved error handling
  • Sanitization & data validating
  • And much more ..

We welcome and actively encourage contributions to this project. Whether you want to report bugs, suggest new features, or improve the existing code, your input is valuable. Join us in making this project better by submitting pull requests, participating in discussions, and sharing your expertise.

About

a lightweight MVC-based PHP micro framework Inspired by Laravel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published