LENKRAD - The modern PHP core

Getting Started

In order to get you set up, you can either create your own setup from scratch (see Quick Start) or use one of the starter projects.
Either way, in order to follow this documentation a working LENKRAD application is necessary.


LENKRAD is an all-purpose framework, but we are going to concentrate on two of the most common use-cases in web development:

  • API - a backend for your powerful frontend, app or embedded software
  • SSR - A all-in-one monolith to generate anything from your personal site to your SAAS business


LENKRAD is very flexible, injectable and customizable and consists of loosely coupled components. This documentation is therefore prone to "but in my case it's different"-situations. Our starter projects are designed to mitigate this issue, but this does not change the fact that one page of this documentation will likely lead you to 3 others. The bad news is: there's a reason we call it a core instead of a framework. The good news is: the learning curve is not even half as bad as one might initially think.

Get in touch

This documentation is a living document inspired by your feedback & questions. If you want to engage, please visit Github (While you are there, don't forget to star)


Sometimes it's necessary to refer to concepts that aren't clear due to conflicting definitions. To avoid confusion as far as possible, we added a glossary:



In PHP, attributes is the name given to what most other languages refer to as annotation. The feature was introduced in PHP8 LENKRAD makes heavy use of its capabilities.


Refers to a Route answering with markup (HTML) using a template.

This very page is a web-route.


Similarly, an API-route is intended to be machine read.

LENKRAD's default response-handler defaults to JSON-format.


Templates are markup-shells (HTML) the rendering process uses to apply data to.

Demo: click here, watch the url and then see this:


In LENKRAD, this concept can be simplified down to code that is executed before your controller logic applies. Middleware can be chained to facilitate guards (e.g. authentication) or to ensure availability of certain data, permissions etc.

Middleware normalization is very little opinionated in LENKRAD as execution chains are loosely coupled.

Dependency Injection

The concept refers to injecting dependencies rather than coupling them. This is were Interfaces shine.

LENKRAD has an auto-wire dependency injection. This allows you to inject concrete dependencies automatically as needed.

Before you move on

Many references on this page assume default settings. Your project might differ in behavior, paths etc.