astralicht / content-delivery
A small and simple PHP MVC framework for content delivery.
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=8.0
README
A small and simple PHP MVC framework for content delivery.
Installation
To install, navigate to the latest release and download it from there. Composer is now supported as of October 1, 2024. To install with Composer, run composer create-project astralicht/content-delivery.
Routing
CDF has support for separate HTTP requests (GET, POST, PUT, DELETE, etc.) as long as the request type is explicitly included in the route.
Route Format
There are two types of route formats for CDF:
- Route to Controller/Model
"{URI}" => ["{filepath to controller/route/view}", [ "{HTTP Request Type (GET, POST, etc.)}" => "{Function name in Class}", ], "{Class name (include namespace if present)}", {boolean value but cdf only accepts if this value is true}],
- Route to View
"{URI}" => ["{filepath to controller/route/view}", ["{HTTP Request Type (GET)}"]],
Database Support
CDF (as of release Dev-006, subject to testing) now has support for database connections other than mysqli.
Controllers and Models
When creating a new controller or model manually, make sure to include their respective namespaces. (e.g. cdf\Controllers or cdf\Models) Until a command line interface has been created, this will have to be taken note of in case something does not work.
Development Server
To start the PHP's development server, you can type in php cdf serve in your terminal in the correct directory.