https://github.com/akshaykhale1992/php-template
A simple PHP Template project to build your next big application or your hobby project.
https://github.com/akshaykhale1992/php-template
php-boilerplate php-template php7
Last synced: 27 days ago
JSON representation
A simple PHP Template project to build your next big application or your hobby project.
- Host: GitHub
- URL: https://github.com/akshaykhale1992/php-template
- Owner: akshaykhale1992
- License: mit
- Created: 2020-04-08T16:57:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-08T17:57:00.000Z (about 6 years ago)
- Last Synced: 2025-07-23T19:34:10.388Z (11 months ago)
- Topics: php-boilerplate, php-template, php7
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Template
A simple PHP Template Project with boilerplate code to start with
# Folder structure
- bootstrap
- app.php: Library loader which autoloads and set-ups all the used Packages
- controllers
- HomeController.php: A sample Controller file
- public
- index.php: The hosted file.
- .env.example: Sample environment file
- .gitignore
- LICENCE
- README.md
- composer.json: Composer file with all dependencies
- composer.lock
- helpers.php: Helper library which is autoloaded in composer.json file
- routes.php: File which contains all the routes for the application
# Dependencies used :package:
- [vlucas/phpdotenv](https://github.com/vlucas/phpdotenv)
- For loading Environment settings from a .env file in Project root directory.
- [nikic/FastRoute](https://github.com/nikic/FastRoute)
- Router used in the Application.
# How to get started :rocket:
composer install # Installing dependencies
cp ./.env.example ./.env # Creating environment file
cd ./public && php -S localhost:8001 # Hosting the application on port 8001
Visit: [http://localhost:8001](http://localhost:8001) to se it in action.
# How do I use it??? :thinking:
1. Add the route in routes.php, refer to sample route for help.
2. Add the method in controllers/HomeController or you can create your own controller file in the same folder.
3. Navigate to your route.
# Why this project??? :thinking:
This project started as a simple minimal PHP boilerplate to get started with a PHP project. A project which will provide you basic routing and environment settings with basic folder structure like an open canvas giving you freedom to add any dependencies that you may require and even change the folder structure as you please. No restriction a simple template for your PHP project.
# Courtesy :heart:
- [nikic](https://github.com/nikic/FastRoute)
- [vlucas](https://github.com/vlucas)