Skip to content

This project is a simple MVC (Model-View-Controller) framework written in PHP.

License

Notifications You must be signed in to change notification settings

mojtabagh0098/simple-mvc-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple MVC Framework

This project is a simple MVC (Model-View-Controller) framework written in PHP. It is designed for developers who want to build web applications with a clear separation of concerns. The framework provides a structured way to manage your code, making it easier to maintain and scale. It is suitable for both beginners and experienced developers looking for a lightweight and easy-to-use framework.

Installation

  1. Clone the repository:
    git clone https://github.com/mojtabagh0098/simple-mvc-framework.git
  2. Navigate to the project directory:
    cd simple-mvc-framework
  3. Install dependencies:
    npm install

Usage

Usage

To use this project, follow these steps:

  1. Start the development server:

    php -S localhost:8000
  2. Open your web browser and navigate to:

    http://localhost:8000
    
  3. You should see the default homepage of the MVC framework.

Example

To create a new controller, follow these steps:

  1. Create a new PHP file in the controllers directory, for example ExampleController.php:

    <?php
    
    class ExampleController {
        public function index() {
            echo 'Hello, world!';
        }
    }
  2. Define a route for your new controller in the routes.php file:

    $router->addRoute('/example', 'ExampleController::class','index');
  3. Navigate to http://localhost:8000/example in your web browser to see the output.

This is a basic example to get you started. You can create more complex controllers, models, and views as needed.

Contributing

We invite everyone to contribute and improve this MVC framework. Your contributions are valuable and will help make this project better for the community.

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature-branch
  3. Make your changes and commit them:
    git commit -m 'Add some feature'
  4. Push to the branch:
    git push origin feature-branch
  5. Open a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This project is a simple MVC (Model-View-Controller) framework written in PHP.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published