LENKRAD - The modern PHP core
Basics
Advanced
Deployment

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.

Basics

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

Cross-referencing

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)

Terminology

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:

Term
Description
Notes

Attributes

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.

Web-route

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

This very page is a web-route.

API-route

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

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

Templating

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

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

Middleware

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.