A small and simple PHP MVC framework for content delivery.
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.
CDF has support for separate HTTP requests (GET, POST, PUT, DELETE, etc.) as long as the request type is explicitly included in the route.
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)}"]],
CDF (as of release Dev-006, subject to testing) now has support for database connections other than mysqli.
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.
To start the PHP's development server, you can type in php cdf serve in your terminal in the correct directory.