CLI Project Templates

Module: Daf CLI Templates

Source folder: Daf/ProjectsTemplates

API Template (webapi)

Generates a minimal API project with ApplicationEx, ApiControllers/WeatherController.php, and vendor bootstrap.

Default behavior includes route prefix api and sample forecast endpoint.

Run: daf create webapi then daf watch.

Web Application Template (webapp)

Generates MVC-style starter with controllers and views, including Home/Counter/FetchData-style setup through sample controllers and page components.

Includes examples for form binding (AutoConstruct), placeholder usage, and routed controllers.

Run: daf create webapp then daf watch.

Clean Web Application Template (cleanwebapp)

Generates a minimal base with ApplicationEx, imports shell, and vendor bootstrap only.

Recommended for teams that want to scaffold architecture from scratch and add features incrementally via daf generate.

Run: daf create cleanwebapp, add first route/page, then daf watch.

Suggested Starting Flow

  1. Create project with the closest template.
  2. Run daf watch and verify baseline.
  3. Generate missing building blocks (controller, model, component, dbset).
  4. Add dependencies with daf download as needed.