astralicht/content-delivery

A small and simple PHP MVC framework for content delivery.

v0.2.0 2024-09-30 16:39 UTC

This package is auto-updated.

Last update: 2025-06-08 13:38:22 UTC


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:

  1. 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}],
  1. 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.