https://github.com/dayitv89/base_php
basic routing and code structured template in core php. Good for POC, small projects.
https://github.com/dayitv89/base_php
php php-framework routing-engine
Last synced: about 1 month ago
JSON representation
basic routing and code structured template in core php. Good for POC, small projects.
- Host: GitHub
- URL: https://github.com/dayitv89/base_php
- Owner: dayitv89
- License: mit
- Created: 2017-09-13T14:21:36.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-09T20:15:36.000Z (over 8 years ago)
- Last Synced: 2025-12-27T00:04:13.597Z (6 months ago)
- Topics: php, php-framework, routing-engine
- Language: PHP
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# base routing in core php
 
### Routes `.htaccess` contains
```
RewriteEngine On
RewriteBase /base_php/codes
RewriteCond $1 !^(index\.php|public|res|robots\.txt)
RewriteRule ^(.*)$ index.php?_path_=$1 [L,QSA]
ErrorDocument 404 /index.php?_error_=404.php
ErrorDocument 500 /index.php?_error_=500.php
```
`RewriteBase /base_php`, where `base_php/codes` is the root dir like `[http://localhost/base_php/codes](http://localhost/base_php/codes)`.
If Root like `[http://localhost/](http://localhost/)`, write `RewriteBase /`,
### Architecture
- `public` and `res` folder and subfolders are ignored in path.
- Other all path are pass by CGI to the `index.php`, routes are defined at `routes.php`
- All config variables available at `config.php`
- Error page available at `error` folder, server errors reports as `ErrorDocument 404 /index.php?_error_=404.php` in `.htaccess`. or other error report as `redirectError` at `route_logic.php`.
- Write all logic inside `src` folder.
### Feedbacks
- I love to hear your valuable feedbacks, suggestions & issues. Please raise a issue on the repo or email me (as subject: 'base_php#issue <topic>') @ `er.gauravds@gmail.com`.
❤️ Voila! Happy coding...