Download the PHP package sigawa/mvc-core without Composer
On this page you can find all versions of the php package sigawa/mvc-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sigawa/mvc-core
More information about sigawa/mvc-core
Files in sigawa/mvc-core
Package mvc-core
Short Description Customized MVC mini-framework for Dev. purposes and offers room for improvements
License MIT
Informations about the package mvc-core
Custom MVC Framework
π Introduction
Welcome to the Custom MVC Framework! This framework is inspired by the routing capabilities of Laravel, Symfony, and CodeIgniter. It's designed to be lightweight, flexible, and easy to use, making it ideal for developers seeking to understand the inner workings of an MVC framework or build small to medium-sized applications without the overhead of a full-fledged framework.
π οΈ Features
- Lightweight and Fast: Minimal overhead, optimized for performance.
- MVC Structure: Clean separation of concerns with Models, Views, and Controllers.
- Powerful Routing: Simplified and efficient routing system.
- Database Integration: User-friendly database abstraction layer.
- CRUD Class: Pre-built, customizable CRUD operations.
- Command-Line Utility: The
mcconsole
tool for seamless project management (create, make, serve, etc.). - Templating Engine: Basic templating for dynamic views.
- Error Handling: Developer-friendly error pages and detailed stack traces.
π Requirements
- PHP 7.4 or higher
- Composer
π§βπ» Installation
1. Install via Composer
WHAT'S NEW
API calls and protected routes using Middlewares Auth logic handling seamlessly with access_tokens
2. Clone the Repository
After cloning, copy the mcconsole
file to your project root directory to enable the command-line utility.
3. Initialize a New Project
Follow the prompts to set up your project structure automatically.
4. Configure Your Environment
Copy the example .env
file and customize it for your environment:
π¦ Getting Started
Running the Application
Use the built-in PHP server or the mcconsole serve
command:
or
Visit http://localhost:8000
to view your application.
π Documentation
Routing
Define routes in your public/index.php
file:
Controllers
Generate a controller using:
Example:
Models
Generate a model using:
Example:
CRUD Operations
Example CRUD usage:
NOTE: More of these CRUD methods are implemented in the Model class and can be called statically in the model classes
Example:
Views
Create views in the app/views
directory:
Bonus
In the vendor directory, locate the js/base.js file and you may use it in your frontend js files for sanitizing and forming the formData object
OTHER ESSENTIAL CLASSES:
For file serving, you can make use of the UtilityController.example class For pdf generation, you can make use of the the PDFGenerator.example class
SINCERITY
I recognize that I may be having ambitious ideas to revolutionize our my MVC ubderstanding, and thatβs a great direction. However, I admit that I have so many conspicous flaws (may be irritating), that is why knowledge is progressive and I will always improve and learn more especially from your observations.
A full controller example, say, ClientsController
NOTE: The Trekafrica namespace is used for demonstration purposes only and should not be used in your application whatsoever.
The above example assumes React-like behaviour (that's why we didn't render a view in the view method, but rather just returned a json response instead). However, you are not limited to rendering a view if you deem so necessary
π€ Contributing
Contributions are welcome! Submit a pull request or open an issue to help improve this framework.
π License
This project is licensed under the MIT License.
β€οΈ Acknowledgments
- Inspired by Laravel, Symfony, and CodeIgniter routing mechanisms.
- Special thanks to all contributors.
Happy Coding! π
- No hard feelings. I created this project as a beginner in MVC, feel free to critisize and do not forget to point out the burning issues you discovered.
- I depend on your feedback, positive or discouraging, am ready to gusp all...so, start sending them right away.
- Explore the architectutre ... create from or add to IT
All versions of mvc-core with dependencies
symfony/console Version 7.1.x-dev
phpmailer/phpmailer Version dev-master
predis/predis Version ^3.0@alpha