update
This commit is contained in:
1438
templates/Referenz/BeginnerGuide.md
Normal file
1438
templates/Referenz/BeginnerGuide.md
Normal file
File diff suppressed because it is too large
Load Diff
537
templates/Referenz/Cheatsheet.md
Normal file
537
templates/Referenz/Cheatsheet.md
Normal file
@@ -0,0 +1,537 @@
|
||||
```
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>PHP Cheatsheet</title>
|
||||
<style>
|
||||
@page { size: A4 landscape; margin: 0; }
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
:root {
|
||||
--php: #777BB4;
|
||||
--php-dark: #4F5B93;
|
||||
--php-darker: #2C3E66;
|
||||
--ink: #1a1a1a;
|
||||
--muted: #5a6470;
|
||||
--line: #d8dde3;
|
||||
--bg-soft: #f5f5fb;
|
||||
--code-bg: #1e2a3a;
|
||||
--code-fg: #e6e6e6;
|
||||
--plus: #2c8a3e;
|
||||
--minus: #c0392b;
|
||||
}
|
||||
|
||||
html, body {
|
||||
font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
|
||||
color: var(--ink);
|
||||
font-size: 8pt;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.page {
|
||||
width: 297mm;
|
||||
height: 210mm;
|
||||
padding: 7mm 9mm 18mm 9mm;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* ===== HERO ===== */
|
||||
.hero {
|
||||
display: table;
|
||||
width: 100%;
|
||||
border-bottom: 2pt solid var(--ink);
|
||||
padding-bottom: 2.5mm;
|
||||
margin-bottom: 4mm;
|
||||
}
|
||||
.hero-logo, .hero-text, .hero-meta {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.hero-logo { width: 18mm; padding-right: 4mm; }
|
||||
.hero-logo-box {
|
||||
width: 15mm; height: 15mm;
|
||||
background: linear-gradient(135deg, var(--php) 0%, var(--php-dark) 100%);
|
||||
border-radius: 4mm;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
color: white; font-size: 12pt; font-weight: 800;
|
||||
}
|
||||
.hero h1 { font-size: 18pt; font-weight: 800; letter-spacing: -0.5pt; line-height: 1; }
|
||||
.hero h1 .accent { color: var(--php); }
|
||||
.hero .sub { font-size: 9pt; color: var(--muted); margin-top: 1mm; }
|
||||
.hero-meta { width: 35mm; text-align: right; }
|
||||
.hero-meta .ver {
|
||||
display: inline-block;
|
||||
background: var(--ink); color: white;
|
||||
padding: 1mm 3mm; border-radius: 1.5mm;
|
||||
font-size: 9pt; font-weight: 700;
|
||||
}
|
||||
.hero-meta .tag {
|
||||
display: block; margin-top: 1mm;
|
||||
font-size: 7pt; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5pt;
|
||||
}
|
||||
|
||||
/* ===== MAIN GRID: 4 columns ===== */
|
||||
.main {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
gap: 3mm;
|
||||
}
|
||||
.col { display: flex; flex-direction: column; gap: 3mm; }
|
||||
|
||||
/* ===== BLOCK ===== */
|
||||
.block {
|
||||
background: white;
|
||||
border: 0.5pt solid var(--line);
|
||||
border-radius: 2mm;
|
||||
overflow: hidden;
|
||||
}
|
||||
.block-head {
|
||||
background: var(--php);
|
||||
color: white;
|
||||
padding: 1.3mm 2.5mm;
|
||||
font-size: 8pt;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5pt;
|
||||
display: flex; align-items: center; gap: 2mm;
|
||||
}
|
||||
.block-head .ico { width: 3.5mm; height: 3.5mm; flex-shrink: 0; }
|
||||
.block-body { padding: 1.8mm 2.5mm; }
|
||||
|
||||
/* ===== TABLES ===== */
|
||||
table { width: 100%; border-collapse: collapse; font-size: 7.5pt; }
|
||||
td { padding: 0.8mm 1mm; vertical-align: top; border-bottom: 0.3pt solid var(--bg-soft); }
|
||||
tr:last-child td { border-bottom: none; }
|
||||
td.k {
|
||||
font-family: "SF Mono", Consolas, monospace;
|
||||
font-size: 7pt;
|
||||
color: var(--php-dark);
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
width: 50%;
|
||||
}
|
||||
td.v { color: var(--ink); }
|
||||
|
||||
/* ===== CODE ===== */
|
||||
.code {
|
||||
background: var(--code-bg);
|
||||
color: var(--code-fg);
|
||||
font-family: "SF Mono", Consolas, monospace;
|
||||
font-size: 6.5pt;
|
||||
line-height: 1.4;
|
||||
padding: 1.5mm 2mm;
|
||||
white-space: pre;
|
||||
overflow: hidden;
|
||||
}
|
||||
.c { color: #6b8aae; font-style: italic; }
|
||||
.k { color: #ff79c6; }
|
||||
.s { color: #f1c40f; }
|
||||
.f { color: #50fa7b; }
|
||||
.t { color: #8be9fd; }
|
||||
.v { color: #ffb86c; }
|
||||
|
||||
/* ===== INLINE CODE ===== */
|
||||
code.inline {
|
||||
font-family: "SF Mono", Consolas, monospace;
|
||||
font-size: 7pt;
|
||||
background: var(--bg-soft);
|
||||
padding: 0.3mm 1mm;
|
||||
border-radius: 0.8mm;
|
||||
color: var(--php-dark);
|
||||
}
|
||||
|
||||
/* ===== KACHEL-GRID ===== */
|
||||
.tiles {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1.2mm;
|
||||
}
|
||||
.tile {
|
||||
background: var(--bg-soft);
|
||||
border-left: 1.5pt solid var(--php);
|
||||
border-radius: 1mm;
|
||||
padding: 1.2mm 1.8mm;
|
||||
display: flex; align-items: flex-start; gap: 1.5mm;
|
||||
}
|
||||
.tile-ico {
|
||||
width: 3.5mm; height: 3.5mm; flex-shrink: 0;
|
||||
background: var(--php-dark);
|
||||
border-radius: 50%;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
margin-top: 0.2mm;
|
||||
}
|
||||
.tile-ico svg { width: 2mm; height: 2mm; }
|
||||
.tile-text { font-size: 7pt; line-height: 1.25; }
|
||||
.tile-text b { color: var(--php-dark); display: block; font-size: 7.5pt; }
|
||||
.tile-text span { color: var(--muted); font-size: 6.3pt; }
|
||||
|
||||
/* ===== DIRECTIVES GRID ===== */
|
||||
.dirgrid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1mm;
|
||||
}
|
||||
.dir {
|
||||
background: var(--bg-soft);
|
||||
padding: 0.8mm 1.3mm;
|
||||
border-radius: 1mm;
|
||||
font-size: 6.5pt;
|
||||
}
|
||||
.dir b { font-family: "SF Mono", Consolas, monospace; color: var(--php-dark); display: block; font-size: 7.3pt; }
|
||||
.dir span { color: var(--muted); font-size: 6pt; }
|
||||
|
||||
/* ===== SPLIT ===== */
|
||||
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2mm; }
|
||||
.split-col h4 {
|
||||
font-size: 6.5pt; font-weight: 700; text-transform: uppercase;
|
||||
letter-spacing: 0.4pt; margin-bottom: 0.8mm;
|
||||
}
|
||||
.split-col.plus h4 { color: var(--plus); }
|
||||
.split-col.minus h4 { color: var(--minus); }
|
||||
.split-col ul { list-style: none; }
|
||||
.split-col li {
|
||||
font-size: 7pt; padding-left: 2.5mm; position: relative;
|
||||
margin-bottom: 0.5mm; line-height: 1.25;
|
||||
}
|
||||
.split-col.plus li::before { content: "+"; position: absolute; left: 0; color: var(--plus); font-weight: 800; }
|
||||
.split-col.minus li::before { content: "−"; position: absolute; left: 0; color: var(--minus); font-weight: 800; }
|
||||
|
||||
/* ===== FOOTER ===== */
|
||||
.footer {
|
||||
position: absolute;
|
||||
left: 9mm;
|
||||
right: 9mm;
|
||||
bottom: 7mm;
|
||||
background: var(--php-darker);
|
||||
color: white;
|
||||
border-radius: 2mm;
|
||||
padding: 2.5mm 4mm;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr auto;
|
||||
gap: 4mm;
|
||||
align-items: center;
|
||||
font-size: 7pt;
|
||||
}
|
||||
.foot-item { line-height: 1.3; }
|
||||
.foot-item b { color: #F1C40F; display: block; font-size: 6.5pt; text-transform: uppercase; letter-spacing: 0.5pt; margin-bottom: 0.5mm; }
|
||||
.foot-item code {
|
||||
font-family: "SF Mono", Consolas, monospace;
|
||||
font-size: 6.5pt;
|
||||
background: rgba(255,255,255,0.15);
|
||||
padding: 0.3mm 1mm;
|
||||
border-radius: 0.8mm;
|
||||
}
|
||||
.foot-tag {
|
||||
background: var(--php); color: white;
|
||||
padding: 1.5mm 3mm; border-radius: 1.5mm;
|
||||
font-weight: 800; font-size: 8pt;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page">
|
||||
|
||||
<!-- HERO -->
|
||||
<header class="hero">
|
||||
<div class="hero-logo"><div class="hero-logo-box">php</div></div>
|
||||
<div class="hero-text">
|
||||
<h1><span class="accent">PHP</span> Cheatsheet</h1>
|
||||
<div class="sub">Syntax, OOP, Type-System, Standard-Funktionen & Ökosystem auf einen Blick</div>
|
||||
</div>
|
||||
<div class="hero-meta">
|
||||
<span class="ver">8.4</span>
|
||||
<span class="tag">Stand 2026</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- MAIN -->
|
||||
<main class="main">
|
||||
|
||||
<!-- SPALTE 1 -->
|
||||
<div class="col">
|
||||
|
||||
<section class="block">
|
||||
<div class="block-head">
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<path d="M3 6h18M3 12h18M3 18h18"/>
|
||||
</svg>
|
||||
Variablen & Typen
|
||||
</div>
|
||||
<div class="block-body">
|
||||
<table>
|
||||
<tr><td class="k">$x = 42</td><td class="v">int</td></tr>
|
||||
<tr><td class="k">$x = 3.14</td><td class="v">float</td></tr>
|
||||
<tr><td class="k">$x = "Hi"</td><td class="v">string</td></tr>
|
||||
<tr><td class="k">$x = true</td><td class="v">bool</td></tr>
|
||||
<tr><td class="k">$x = null</td><td class="v">null</td></tr>
|
||||
<tr><td class="k">$x = [1,2,3]</td><td class="v">array</td></tr>
|
||||
<tr><td class="k">$x = ['k'=>1]</td><td class="v">assoc array</td></tr>
|
||||
<tr><td class="k">gettype($x)</td><td class="v">Typ-Name</td></tr>
|
||||
<tr><td class="k">is_int($x)</td><td class="v">Typ-Check</td></tr>
|
||||
<tr><td class="k">(int)$x</td><td class="v">Cast</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="block">
|
||||
<div class="block-head">
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<polygon points="13,2 3,14 12,14 11,22 21,10 12,10"/>
|
||||
</svg>
|
||||
String-Funktionen
|
||||
</div>
|
||||
<div class="block-body">
|
||||
<table>
|
||||
<tr><td class="k">strlen($s)</td><td class="v">Länge</td></tr>
|
||||
<tr><td class="k">strtolower</td><td class="v">klein</td></tr>
|
||||
<tr><td class="k">strtoupper</td><td class="v">groß</td></tr>
|
||||
<tr><td class="k">trim($s)</td><td class="v">Whitespace weg</td></tr>
|
||||
<tr><td class="k">explode(',', $s)</td><td class="v">→ array</td></tr>
|
||||
<tr><td class="k">implode(',', $a)</td><td class="v">→ string</td></tr>
|
||||
<tr><td class="k">str_replace</td><td class="v">a → b</td></tr>
|
||||
<tr><td class="k">str_contains</td><td class="v">enthält?</td></tr>
|
||||
<tr><td class="k">sprintf("%d", 1)</td><td class="v">format</td></tr>
|
||||
<tr><td class="k">"$name"</td><td class="v">Interpolation</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- SPALTE 2 -->
|
||||
<div class="col">
|
||||
|
||||
<section class="block">
|
||||
<div class="block-head">
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<polyline points="16,18 22,12 16,6"/><polyline points="8,6 2,12 8,18"/>
|
||||
</svg>
|
||||
Moderne Klasse (PHP 8)
|
||||
</div>
|
||||
<div class="block-body">
|
||||
<div class="code"><span class="k">class</span> <span class="t">User</span> {
|
||||
<span class="k">public function</span> <span class="f">__construct</span>(
|
||||
<span class="k">public readonly</span> <span class="t">string</span> <span class="v">$name</span>,
|
||||
<span class="k">public readonly</span> <span class="t">int</span> <span class="v">$age</span>,
|
||||
<span class="k">private</span> ?<span class="t">string</span> <span class="v">$email</span> = <span class="k">null</span>,
|
||||
) {}
|
||||
|
||||
<span class="k">public function</span> <span class="f">isAdult</span>(): <span class="t">bool</span> {
|
||||
<span class="k">return</span> <span class="v">$this</span>->age >= <span class="s">18</span>;
|
||||
}
|
||||
}
|
||||
|
||||
<span class="v">$u</span> = <span class="k">new</span> <span class="t">User</span>(name: <span class="s">'Marek'</span>, age: <span class="s">34</span>);</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="block">
|
||||
<div class="block-head">
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<circle cx="12" cy="12" r="10"/><polyline points="12,6 12,12 16,14"/>
|
||||
</svg>
|
||||
Array-Funktionen
|
||||
</div>
|
||||
<div class="block-body">
|
||||
<table>
|
||||
<tr><td class="k">count($a)</td><td class="v">Anzahl</td></tr>
|
||||
<tr><td class="k">array_map(fn, $a)</td><td class="v">transform</td></tr>
|
||||
<tr><td class="k">array_filter</td><td class="v">filtern</td></tr>
|
||||
<tr><td class="k">array_reduce</td><td class="v">aggregieren</td></tr>
|
||||
<tr><td class="k">array_keys</td><td class="v">→ Keys</td></tr>
|
||||
<tr><td class="k">array_values</td><td class="v">→ Values</td></tr>
|
||||
<tr><td class="k">in_array($x, $a)</td><td class="v">enthält?</td></tr>
|
||||
<tr><td class="k">array_merge</td><td class="v">a + b</td></tr>
|
||||
<tr><td class="k">sort / usort</td><td class="v">sortieren</td></tr>
|
||||
<tr><td class="k">array_unique</td><td class="v">dedupe</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- SPALTE 3 -->
|
||||
<div class="col">
|
||||
|
||||
<section class="block">
|
||||
<div class="block-head">
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<path d="M7 17l10-10M17 17H7V7"/>
|
||||
</svg>
|
||||
Control Flow
|
||||
</div>
|
||||
<div class="block-body">
|
||||
<div class="code"><span class="k">if</span> (<span class="v">$x</span> > <span class="s">0</span>) { ... }
|
||||
<span class="k">elseif</span> (<span class="v">$x</span> < <span class="s">0</span>) { ... }
|
||||
<span class="k">else</span> { ... }
|
||||
|
||||
<span class="k">match</span>(<span class="v">$status</span>) {
|
||||
<span class="s">'ok'</span>, <span class="s">'good'</span> => <span class="s">'positiv'</span>,
|
||||
<span class="s">'err'</span> => <span class="s">'negativ'</span>,
|
||||
<span class="k">default</span> => <span class="s">'?'</span>,
|
||||
};
|
||||
|
||||
<span class="k">foreach</span> (<span class="v">$items</span> <span class="k">as</span> <span class="v">$k</span> => <span class="v">$v</span>) { ... }
|
||||
<span class="k">for</span> (<span class="v">$i</span>=<span class="s">0</span>; <span class="v">$i</span><<span class="s">10</span>; <span class="v">$i</span>++) { ... }
|
||||
<span class="k">while</span> (<span class="v">$cond</span>) { ... }</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="block">
|
||||
<div class="block-head">
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>
|
||||
</svg>
|
||||
Enums & Match
|
||||
</div>
|
||||
<div class="block-body">
|
||||
<div class="code"><span class="k">enum</span> <span class="t">Status</span>: <span class="t">string</span> {
|
||||
<span class="k">case</span> <span class="t">Draft</span> = <span class="s">'draft'</span>;
|
||||
<span class="k">case</span> <span class="t">Published</span> = <span class="s">'published'</span>;
|
||||
<span class="k">case</span> <span class="t">Archived</span> = <span class="s">'archived'</span>;
|
||||
|
||||
<span class="k">public function</span> <span class="f">label</span>(): <span class="t">string</span> {
|
||||
<span class="k">return match</span>(<span class="v">$this</span>) {
|
||||
<span class="t">self</span>::<span class="t">Draft</span> => <span class="s">'Entwurf'</span>,
|
||||
<span class="t">self</span>::<span class="t">Published</span> => <span class="s">'Veröffentlicht'</span>,
|
||||
<span class="t">self</span>::<span class="t">Archived</span> => <span class="s">'Archiv'</span>,
|
||||
};
|
||||
}
|
||||
}</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="block">
|
||||
<div class="block-head">
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12" y2="16"/>
|
||||
</svg>
|
||||
Fehler & Try/Catch
|
||||
</div>
|
||||
<div class="block-body">
|
||||
<div class="code"><span class="k">try</span> {
|
||||
<span class="v">$result</span> = <span class="f">risky</span>();
|
||||
} <span class="k">catch</span> (\<span class="t">ValueError</span> <span class="v">$e</span>) {
|
||||
<span class="f">log</span>(<span class="v">$e</span>->getMessage());
|
||||
} <span class="k">catch</span> (\<span class="t">Exception</span> <span class="v">$e</span>) {
|
||||
<span class="k">throw new</span> \<span class="t">AppError</span>(...);
|
||||
} <span class="k">finally</span> {
|
||||
<span class="f">cleanup</span>();
|
||||
}</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- SPALTE 4 -->
|
||||
<div class="col">
|
||||
|
||||
<section class="block">
|
||||
<div class="block-head">
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<circle cx="12" cy="12" r="3"/><circle cx="12" cy="12" r="9"/>
|
||||
</svg>
|
||||
Ökosystem
|
||||
</div>
|
||||
<div class="block-body">
|
||||
<div class="tiles">
|
||||
<div class="tile">
|
||||
<div class="tile-ico"><svg viewBox="0 0 24 24" fill="white"><polygon points="12,2 22,22 2,22"/></svg></div>
|
||||
<div class="tile-text"><b>Composer</b><span>Paket-Manager</span></div>
|
||||
</div>
|
||||
<div class="tile">
|
||||
<div class="tile-ico"><svg viewBox="0 0 24 24" fill="white"><circle cx="12" cy="12" r="10"/></svg></div>
|
||||
<div class="tile-text"><b>Laravel</b><span>Full-Stack</span></div>
|
||||
</div>
|
||||
<div class="tile">
|
||||
<div class="tile-ico"><svg viewBox="0 0 24 24" fill="white"><rect x="4" y="4" width="16" height="16"/></svg></div>
|
||||
<div class="tile-text"><b>Symfony</b><span>Enterprise</span></div>
|
||||
</div>
|
||||
<div class="tile">
|
||||
<div class="tile-ico"><svg viewBox="0 0 24 24" fill="white"><polygon points="12,2 22,22 2,22"/></svg></div>
|
||||
<div class="tile-text"><b>PHPUnit</b><span>Tests</span></div>
|
||||
</div>
|
||||
<div class="tile">
|
||||
<div class="tile-ico"><svg viewBox="0 0 24 24" fill="white"><circle cx="12" cy="12" r="10"/></svg></div>
|
||||
<div class="tile-text"><b>PHPStan</b><span>Static-Analyse</span></div>
|
||||
</div>
|
||||
<div class="tile">
|
||||
<div class="tile-ico"><svg viewBox="0 0 24 24" fill="white"><rect x="4" y="4" width="16" height="16"/></svg></div>
|
||||
<div class="tile-text"><b>Shopware</b><span>E-Commerce</span></div>
|
||||
</div>
|
||||
<div class="tile">
|
||||
<div class="tile-ico"><svg viewBox="0 0 24 24" fill="white"><polygon points="12,2 22,22 2,22"/></svg></div>
|
||||
<div class="tile-text"><b>WordPress</b><span>CMS</span></div>
|
||||
</div>
|
||||
<div class="tile">
|
||||
<div class="tile-ico"><svg viewBox="0 0 24 24" fill="white"><circle cx="12" cy="12" r="10"/></svg></div>
|
||||
<div class="tile-text"><b>Doctrine</b><span>ORM & DBAL</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="block">
|
||||
<div class="block-head">
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>
|
||||
</svg>
|
||||
Idiome vs. Anti-Patterns
|
||||
</div>
|
||||
<div class="block-body">
|
||||
<div class="split">
|
||||
<div class="split-col plus">
|
||||
<h4>Idiomatisch</h4>
|
||||
<ul>
|
||||
<li>strict_types=1</li>
|
||||
<li>Type-Hints überall</li>
|
||||
<li>readonly Properties</li>
|
||||
<li>Composer Autoload</li>
|
||||
<li>PSR-12 Coding-Style</li>
|
||||
<li>match statt switch</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="split-col minus">
|
||||
<h4>Vermeiden</h4>
|
||||
<ul>
|
||||
<li>mysql_* Funktionen</li>
|
||||
<li>extract() von User</li>
|
||||
<li>eval() jeglicher Art</li>
|
||||
<li>Globals ($GLOBALS)</li>
|
||||
<li>@-Suppression</li>
|
||||
<li>include statt require_once</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- FOOTER -->
|
||||
<footer class="footer">
|
||||
<div class="foot-item">
|
||||
<b>Projekt starten</b>
|
||||
<code>composer init</code>
|
||||
</div>
|
||||
<div class="foot-item">
|
||||
<b>Server starten</b>
|
||||
<code>php -S localhost:8000</code>
|
||||
</div>
|
||||
<div class="foot-item">
|
||||
<b>Tests</b>
|
||||
<code>vendor/bin/phpunit</code>
|
||||
</div>
|
||||
<div class="foot-item">
|
||||
<b>Static Analysis</b>
|
||||
<code>vendor/bin/phpstan analyse</code>
|
||||
</div>
|
||||
<div class="foot-tag">php.net</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
2542
templates/Referenz/ExtendedGuide.md
Normal file
2542
templates/Referenz/ExtendedGuide.md
Normal file
File diff suppressed because it is too large
Load Diff
1874
templates/Referenz/IntermediateGuide.md
Normal file
1874
templates/Referenz/IntermediateGuide.md
Normal file
File diff suppressed because it is too large
Load Diff
383
templates/Referenz/MiniGuide.md
Normal file
383
templates/Referenz/MiniGuide.md
Normal file
@@ -0,0 +1,383 @@
|
||||
```
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>PHP Mini-Guide</title>
|
||||
<style>
|
||||
@page {
|
||||
size: A4;
|
||||
margin: 18mm 18mm 16mm 18mm;
|
||||
@bottom-center {
|
||||
content: counter(page) " / " counter(pages);
|
||||
font-family: -apple-system, "Segoe UI", sans-serif;
|
||||
font-size: 8pt;
|
||||
color: #888;
|
||||
}
|
||||
@bottom-right {
|
||||
content: "PHP Mini-Guide";
|
||||
font-family: -apple-system, "Segoe UI", sans-serif;
|
||||
font-size: 8pt;
|
||||
color: #888;
|
||||
}
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
:root {
|
||||
--php: #777BB4;
|
||||
--php-dark: #4F5B93;
|
||||
--php-darker: #2C3E66;
|
||||
--ink: #1a1a1a;
|
||||
--muted: #5a6470;
|
||||
--line: #d8dde3;
|
||||
--bg-soft: #f5f5fb;
|
||||
--code-bg: #1e2a3a;
|
||||
--code-fg: #e6e6e6;
|
||||
--plus: #2c8a3e;
|
||||
--minus: #c0392b;
|
||||
}
|
||||
|
||||
html, body {
|
||||
font-family: Charter, "Source Serif Pro", Georgia, serif;
|
||||
color: var(--ink);
|
||||
font-size: 10.5pt;
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
/* ===== HEAD ===== */
|
||||
.head {
|
||||
display: table;
|
||||
width: 100%;
|
||||
border-bottom: 2pt solid var(--ink);
|
||||
padding-bottom: 4mm;
|
||||
margin-bottom: 5mm;
|
||||
}
|
||||
.head-logo, .head-title, .head-meta {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.head-logo {
|
||||
width: 20mm;
|
||||
padding-right: 5mm;
|
||||
}
|
||||
.head-logo-box {
|
||||
width: 16mm; height: 16mm;
|
||||
background: linear-gradient(135deg, var(--php) 0%, var(--php-dark) 100%);
|
||||
border-radius: 4mm;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
font-family: -apple-system, sans-serif;
|
||||
font-size: 11pt; font-weight: 800;
|
||||
color: white;
|
||||
}
|
||||
.head-title h1 {
|
||||
font-family: -apple-system, sans-serif;
|
||||
font-size: 20pt;
|
||||
font-weight: 800;
|
||||
color: var(--php-dark);
|
||||
letter-spacing: -0.5pt;
|
||||
line-height: 1.1;
|
||||
}
|
||||
.head-title h1 .accent { color: var(--php); }
|
||||
.head-title .subtitle {
|
||||
font-family: -apple-system, sans-serif;
|
||||
font-size: 10pt;
|
||||
color: var(--muted);
|
||||
margin-top: 1mm;
|
||||
}
|
||||
.head-meta {
|
||||
width: 35mm;
|
||||
text-align: right;
|
||||
font-family: -apple-system, sans-serif;
|
||||
}
|
||||
.head-meta .badge {
|
||||
display: inline-block;
|
||||
background: var(--ink);
|
||||
color: white;
|
||||
padding: 1.2mm 3mm;
|
||||
border-radius: 1.5mm;
|
||||
font-size: 8.5pt;
|
||||
font-weight: 700;
|
||||
}
|
||||
.head-meta .time {
|
||||
display: block;
|
||||
font-size: 7.5pt;
|
||||
color: var(--muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1pt;
|
||||
margin-top: 1mm;
|
||||
}
|
||||
|
||||
/* ===== GAP-OPENER ===== */
|
||||
.gap {
|
||||
background: var(--bg-soft);
|
||||
border-left: 3pt solid var(--php);
|
||||
padding: 3.5mm 5mm;
|
||||
margin: 0 0 6mm 0;
|
||||
font-style: italic;
|
||||
font-size: 10.5pt;
|
||||
}
|
||||
.gap > b:first-child {
|
||||
font-style: normal;
|
||||
color: var(--php-dark);
|
||||
font-family: -apple-system, sans-serif;
|
||||
text-transform: uppercase;
|
||||
font-size: 8pt;
|
||||
letter-spacing: 1pt;
|
||||
display: block;
|
||||
margin-bottom: 1.5mm;
|
||||
}
|
||||
|
||||
/* ===== SECTIONS ===== */
|
||||
h2 {
|
||||
font-family: -apple-system, sans-serif;
|
||||
font-size: 13pt;
|
||||
font-weight: 700;
|
||||
color: var(--php-dark);
|
||||
margin: 6mm 0 2.5mm 0;
|
||||
page-break-after: avoid;
|
||||
}
|
||||
h3 {
|
||||
font-family: -apple-system, sans-serif;
|
||||
font-size: 10.5pt;
|
||||
font-weight: 700;
|
||||
color: var(--ink);
|
||||
margin: 4mm 0 1.5mm 0;
|
||||
page-break-after: avoid;
|
||||
}
|
||||
p {
|
||||
margin-bottom: 2.5mm;
|
||||
text-align: justify;
|
||||
hyphens: auto;
|
||||
}
|
||||
p b { color: var(--php-dark); }
|
||||
ul, ol { margin: 1.5mm 0 3mm 6mm; }
|
||||
li { margin-bottom: 1mm; }
|
||||
|
||||
/* ===== CODE ===== */
|
||||
pre {
|
||||
background: var(--code-bg);
|
||||
color: var(--code-fg);
|
||||
font-family: "SF Mono", Consolas, monospace;
|
||||
font-size: 8.5pt;
|
||||
line-height: 1.5;
|
||||
padding: 3mm 4mm;
|
||||
border-radius: 2mm;
|
||||
margin: 2.5mm 0 3.5mm 0;
|
||||
white-space: pre;
|
||||
overflow: hidden;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
.c { color: #6b8aae; font-style: italic; }
|
||||
.k { color: #ff79c6; }
|
||||
.s { color: #f1c40f; }
|
||||
.f { color: #50fa7b; }
|
||||
.t { color: #8be9fd; }
|
||||
.v { color: #ffb86c; }
|
||||
|
||||
code.inline {
|
||||
font-family: "SF Mono", Consolas, monospace;
|
||||
font-size: 9pt;
|
||||
background: var(--bg-soft);
|
||||
padding: 0.3mm 1.5mm;
|
||||
border-radius: 1mm;
|
||||
color: var(--php-dark);
|
||||
}
|
||||
|
||||
/* ===== CALLOUT ===== */
|
||||
.callout {
|
||||
border-radius: 2mm;
|
||||
padding: 2.5mm 4mm;
|
||||
margin: 3mm 0;
|
||||
font-size: 10pt;
|
||||
page-break-inside: avoid;
|
||||
display: grid;
|
||||
grid-template-columns: 6mm 1fr;
|
||||
gap: 3mm;
|
||||
}
|
||||
.callout-icon {
|
||||
font-family: -apple-system, sans-serif;
|
||||
font-weight: 800;
|
||||
font-size: 14pt;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.callout-body > b:first-child {
|
||||
font-family: -apple-system, sans-serif;
|
||||
text-transform: uppercase;
|
||||
font-size: 8pt;
|
||||
letter-spacing: 1pt;
|
||||
display: block;
|
||||
margin-bottom: 1mm;
|
||||
}
|
||||
.callout.tip { background: #e8f4ea; border-left: 3pt solid var(--plus); }
|
||||
.callout.tip .callout-icon, .callout.tip .callout-body > b:first-child { color: var(--plus); }
|
||||
.callout.warn { background: #fdecea; border-left: 3pt solid var(--minus); }
|
||||
.callout.warn .callout-icon, .callout.warn .callout-body > b:first-child { color: var(--minus); }
|
||||
.callout.note { background: var(--bg-soft); border-left: 3pt solid var(--php); }
|
||||
.callout.note .callout-icon, .callout.note .callout-body > b:first-child { color: var(--php-dark); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- ===== HEAD ===== -->
|
||||
<header class="head">
|
||||
<div class="head-logo"><div class="head-logo-box">php</div></div>
|
||||
<div class="head-title">
|
||||
<h1><span class="accent">PHP</span> in 15 Minuten</h1>
|
||||
<div class="subtitle">Dein erstes PHP-Programm – Schritt für Schritt</div>
|
||||
</div>
|
||||
<div class="head-meta">
|
||||
<span class="badge">Mini-Guide</span>
|
||||
<span class="time">15 Min · von Null</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- ===== GAP-OPENER ===== -->
|
||||
<div class="gap">
|
||||
<b>Frage zum Einstieg</b>
|
||||
PHP läuft hinter rund drei Viertel aller Webseiten – inklusive WordPress, Wikipedia und Facebook. Aber wie sieht PHP-Code überhaupt aus, und wie startet man? In 15 Minuten kannst du dein erstes Programm schreiben.
|
||||
</div>
|
||||
|
||||
<!-- ===== SEKTION 1 ===== -->
|
||||
<h2>PHP starten</h2>
|
||||
|
||||
<p>PHP ist eine Programmiersprache, die auf deinem Computer oder einem Webserver läuft. Im Gegensatz zu HTML oder CSS wird PHP nicht im Browser angezeigt – es <i>erzeugt</i> Ausgaben (zum Beispiel HTML), die dann ausgeliefert werden.</p>
|
||||
|
||||
<p>Um anzufangen, brauchst du PHP auf deinem Computer. Auf Mac: <code class="inline">brew install php</code>. Auf Ubuntu: <code class="inline">apt install php8.4-cli</code>. Auf Windows: am einfachsten WSL2 mit Ubuntu darin nutzen.</p>
|
||||
|
||||
<p>PHP-Code lebt in Dateien mit der Endung <code class="inline">.php</code>. Lege eine Datei <code class="inline">hallo.php</code> an mit diesem Inhalt:</p>
|
||||
|
||||
<pre><span class="t"><?php</span>
|
||||
|
||||
<span class="k">echo</span> <span class="s">"Hallo Welt!"</span>;</pre>
|
||||
|
||||
<p>Die erste Zeile <code class="inline"><?php</code> sagt PHP: "ab hier kommt mein Code". Das Wort <code class="inline">echo</code> heißt: "gib das aus, was danach kommt". Strings (also Text) stehen in Anführungszeichen. Jede Anweisung endet mit einem Semikolon.</p>
|
||||
|
||||
<p>Im Terminal ausführen mit:</p>
|
||||
|
||||
<pre>php hallo.php</pre>
|
||||
|
||||
<p>Du siehst "Hallo Welt!" – dein erstes PHP-Programm läuft.</p>
|
||||
|
||||
<!-- ===== SEKTION 2 ===== -->
|
||||
<h2>Variablen</h2>
|
||||
|
||||
<p>Eine <b>Variable</b> ist ein benannter Platz, an dem du einen Wert speicherst. In PHP beginnen Variablen immer mit einem Dollar-Zeichen <code class="inline">$</code>. Das macht sie im Code sofort erkennbar:</p>
|
||||
|
||||
<pre><span class="t"><?php</span>
|
||||
|
||||
<span class="v">$name</span> = <span class="s">"Marek"</span>;
|
||||
<span class="v">$alter</span> = <span class="s">34</span>;
|
||||
<span class="v">$istAktiv</span> = <span class="k">true</span>;
|
||||
|
||||
<span class="k">echo</span> <span class="v">$name</span>;</pre>
|
||||
|
||||
<p>Variablen können verschiedene Arten von Werten enthalten. Die drei wichtigsten:</p>
|
||||
|
||||
<ul>
|
||||
<li><b>Strings</b> – Text in Anführungszeichen, z.B. <code class="inline">"Hallo"</code></li>
|
||||
<li><b>Zahlen</b> – ganze Zahlen (<code class="inline">42</code>) oder Kommazahlen (<code class="inline">3.14</code>)</li>
|
||||
<li><b>Wahrheitswerte</b> – <code class="inline">true</code> (wahr) oder <code class="inline">false</code> (falsch)</li>
|
||||
</ul>
|
||||
|
||||
<p>Mit dem Punkt verbindest du Strings:</p>
|
||||
|
||||
<pre><span class="v">$gruss</span> = <span class="s">"Hallo, "</span> . <span class="v">$name</span> . <span class="s">"!"</span>;
|
||||
<span class="k">echo</span> <span class="v">$gruss</span>; <span class="c">// Hallo, Marek!</span></pre>
|
||||
|
||||
<!-- ===== SEKTION 3 ===== -->
|
||||
<h2>Bedingungen</h2>
|
||||
|
||||
<p>Programme müssen oft entscheiden: "wenn X zutrifft, mach Y, sonst Z". Dafür gibt es <code class="inline">if</code> und <code class="inline">else</code>:</p>
|
||||
|
||||
<pre><span class="v">$alter</span> = <span class="s">17</span>;
|
||||
|
||||
<span class="k">if</span> (<span class="v">$alter</span> >= <span class="s">18</span>) {
|
||||
<span class="k">echo</span> <span class="s">"Du bist erwachsen."</span>;
|
||||
} <span class="k">else</span> {
|
||||
<span class="k">echo</span> <span class="s">"Du bist noch minderjährig."</span>;
|
||||
}</pre>
|
||||
|
||||
<p>Die Klammer hinter <code class="inline">if</code> enthält die Bedingung. Die geschweiften Klammern <code class="inline">{ }</code> umschließen den Code, der ausgeführt wird, wenn die Bedingung wahr ist. <code class="inline">else</code> ist der Block, wenn sie falsch ist.</p>
|
||||
|
||||
<p>Wichtige Vergleichs-Operatoren:</p>
|
||||
|
||||
<ul>
|
||||
<li><code class="inline">==</code> gleich</li>
|
||||
<li><code class="inline">!=</code> ungleich</li>
|
||||
<li><code class="inline"><</code>, <code class="inline">></code> kleiner, größer</li>
|
||||
<li><code class="inline"><=</code>, <code class="inline">>=</code> kleiner-gleich, größer-gleich</li>
|
||||
</ul>
|
||||
|
||||
<div class="callout note">
|
||||
<div class="callout-icon">i</div>
|
||||
<div class="callout-body">
|
||||
<b>Ein Gleichheitszeichen reicht nicht</b>
|
||||
Zum Zuweisen nutzt du <code class="inline">=</code> (ein Gleichheitszeichen). Zum Vergleichen brauchst du <code class="inline">==</code> (zwei). Das ist eine häufige Verwechslung bei Anfängern.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ===== SEKTION 4 ===== -->
|
||||
<h2>Listen und Schleifen</h2>
|
||||
|
||||
<p>Mehrere Werte fasst du in einer <b>Liste</b> zusammen. In PHP heißen Listen <code class="inline">array</code>:</p>
|
||||
|
||||
<pre><span class="v">$obst</span> = [<span class="s">"Apfel"</span>, <span class="s">"Birne"</span>, <span class="s">"Kirsche"</span>];</pre>
|
||||
|
||||
<p>Über jede Liste kannst du mit <code class="inline">foreach</code> Schritt für Schritt gehen:</p>
|
||||
|
||||
<pre><span class="k">foreach</span> (<span class="v">$obst</span> <span class="k">as</span> <span class="v">$frucht</span>) {
|
||||
<span class="k">echo</span> <span class="v">$frucht</span> . <span class="s">"\n"</span>;
|
||||
}</pre>
|
||||
|
||||
<p>Das gibt "Apfel", "Birne", "Kirsche" untereinander aus. Das <code class="inline">\n</code> ist ein Zeilenumbruch. Die Variable <code class="inline">$frucht</code> bekommt bei jedem Durchlauf den nächsten Wert aus der Liste.</p>
|
||||
|
||||
<p>Listen müssen nicht aus Strings bestehen. Zahlen gehen genauso:</p>
|
||||
|
||||
<pre><span class="v">$zahlen</span> = [<span class="s">10</span>, <span class="s">20</span>, <span class="s">30</span>];
|
||||
<span class="v">$summe</span> = <span class="s">0</span>;
|
||||
|
||||
<span class="k">foreach</span> (<span class="v">$zahlen</span> <span class="k">as</span> <span class="v">$zahl</span>) {
|
||||
<span class="v">$summe</span> = <span class="v">$summe</span> + <span class="v">$zahl</span>;
|
||||
}
|
||||
|
||||
<span class="k">echo</span> <span class="v">$summe</span>; <span class="c">// 60</span></pre>
|
||||
|
||||
<!-- ===== SEKTION 5 ===== -->
|
||||
<h2>Funktionen</h2>
|
||||
|
||||
<p>Wenn du denselben Code mehrfach brauchst, packst du ihn in eine <b>Funktion</b>. Du gibst der Funktion einen Namen und kannst sie dann beliebig oft aufrufen:</p>
|
||||
|
||||
<pre><span class="k">function</span> <span class="f">begruessen</span>(<span class="v">$name</span>) {
|
||||
<span class="k">echo</span> <span class="s">"Hallo, "</span> . <span class="v">$name</span> . <span class="s">"!\n"</span>;
|
||||
}
|
||||
|
||||
<span class="f">begruessen</span>(<span class="s">"Marek"</span>);
|
||||
<span class="f">begruessen</span>(<span class="s">"Anna"</span>);
|
||||
<span class="f">begruessen</span>(<span class="s">"Tom"</span>);</pre>
|
||||
|
||||
<p>Die Funktion <code class="inline">begruessen</code> nimmt einen <b>Parameter</b> entgegen (<code class="inline">$name</code>). Beim Aufruf übergibst du den konkreten Wert in den Klammern.</p>
|
||||
|
||||
<p>Funktionen können auch Werte <b>zurückgeben</b>. Dafür gibt es <code class="inline">return</code>:</p>
|
||||
|
||||
<pre><span class="k">function</span> <span class="f">addiere</span>(<span class="v">$a</span>, <span class="v">$b</span>) {
|
||||
<span class="k">return</span> <span class="v">$a</span> + <span class="v">$b</span>;
|
||||
}
|
||||
|
||||
<span class="v">$ergebnis</span> = <span class="f">addiere</span>(<span class="s">3</span>, <span class="s">5</span>);
|
||||
<span class="k">echo</span> <span class="v">$ergebnis</span>; <span class="c">// 8</span></pre>
|
||||
|
||||
<p>Die Funktion macht ihre Berechnung und liefert das Ergebnis zurück. Du fängst es in einer Variable auf und kannst damit weiterarbeiten.</p>
|
||||
|
||||
<div class="callout tip">
|
||||
<div class="callout-icon">✓</div>
|
||||
<div class="callout-body">
|
||||
<b>Übung macht den Meister</b>
|
||||
Schreibe jetzt selbst ein kleines PHP-Programm. Zum Beispiel: eine Liste deiner Lieblings-Filme, die mit <code class="inline">foreach</code> ausgegeben werden. Oder eine Funktion, die das Doppelte einer Zahl zurückgibt. Praktisch ausprobieren ist der schnellste Weg, PHP zu lernen.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
526
templates/Referenz/OnePager.md
Normal file
526
templates/Referenz/OnePager.md
Normal file
@@ -0,0 +1,526 @@
|
||||
```
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>PHP OnePager</title>
|
||||
<style>
|
||||
@page { size: A4 landscape; margin: 0; }
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
:root {
|
||||
--php: #777BB4;
|
||||
--php-dark: #4F5B93;
|
||||
--php-darker: #2C3E66;
|
||||
--accent: #F1C40F;
|
||||
--ink: #1a1a1a;
|
||||
--muted: #5a6470;
|
||||
--line: #e5e5e5;
|
||||
--bg-soft: #f5f5fb;
|
||||
}
|
||||
|
||||
html, body {
|
||||
font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
|
||||
color: var(--ink);
|
||||
font-size: 9.5pt;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.page {
|
||||
width: 297mm;
|
||||
height: 210mm;
|
||||
padding: 9mm 11mm 9mm 11mm;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* ===== HERO ===== */
|
||||
.hero {
|
||||
display: table;
|
||||
width: 100%;
|
||||
margin-bottom: 4mm;
|
||||
}
|
||||
.hero-logo, .hero-text, .hero-stats {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.hero-logo { width: 28mm; padding-right: 5mm; }
|
||||
.hero-logo-box {
|
||||
width: 22mm; height: 22mm;
|
||||
background: linear-gradient(135deg, var(--php) 0%, var(--php-dark) 100%);
|
||||
border-radius: 5mm;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
font-size: 18pt; font-weight: 800;
|
||||
color: white;
|
||||
letter-spacing: -1pt;
|
||||
}
|
||||
.hero h1 {
|
||||
font-size: 20pt;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.5pt;
|
||||
line-height: 1.1;
|
||||
}
|
||||
.hero h1 .accent { color: var(--php); }
|
||||
.hero p {
|
||||
font-size: 9.5pt;
|
||||
color: var(--muted);
|
||||
margin-top: 1mm;
|
||||
}
|
||||
.hero-stats {
|
||||
width: 110mm;
|
||||
text-align: right;
|
||||
}
|
||||
.stats-row {
|
||||
display: inline-table;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.stat-cell {
|
||||
display: table-cell;
|
||||
padding: 0 5mm;
|
||||
text-align: center;
|
||||
border-right: 0.5pt solid var(--line);
|
||||
vertical-align: middle;
|
||||
}
|
||||
.stat-cell:last-child { border-right: none; padding-right: 0; }
|
||||
.stat-cell:first-child { padding-left: 0; }
|
||||
.stat-num {
|
||||
font-size: 14pt;
|
||||
font-weight: 800;
|
||||
color: var(--php);
|
||||
line-height: 1;
|
||||
}
|
||||
.stat-label {
|
||||
font-size: 6.5pt;
|
||||
color: var(--muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5pt;
|
||||
margin-top: 1mm;
|
||||
}
|
||||
|
||||
/* ===== Divider ===== */
|
||||
.divider {
|
||||
height: 1.5pt;
|
||||
background: var(--ink);
|
||||
margin-bottom: 4mm;
|
||||
}
|
||||
|
||||
/* ===== GRID 3-Spalten ===== */
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
gap: 4mm;
|
||||
margin-bottom: 4mm;
|
||||
}
|
||||
.col { display: flex; flex-direction: column; gap: 4mm; }
|
||||
|
||||
.block { display: flex; flex-direction: column; gap: 1.5mm; }
|
||||
.block h2 {
|
||||
font-size: 9.5pt;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5pt;
|
||||
color: var(--php);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2mm;
|
||||
border-bottom: 2pt solid var(--php);
|
||||
padding-bottom: 1.2mm;
|
||||
}
|
||||
.block h2 .ico { width: 4mm; height: 4mm; flex-shrink: 0; }
|
||||
|
||||
/* ===== FEATURE LIST ===== */
|
||||
.feature-list { display: flex; flex-direction: column; gap: 1.5mm; }
|
||||
.feature-row {
|
||||
display: grid;
|
||||
grid-template-columns: 4.5mm 1fr;
|
||||
gap: 1.8mm;
|
||||
align-items: start;
|
||||
}
|
||||
.feature-row .dot {
|
||||
width: 4mm; height: 4mm; margin-top: 0.2mm;
|
||||
background: var(--php);
|
||||
border-radius: 1mm;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
font-size: 6pt; font-weight: 800; color: white;
|
||||
}
|
||||
.feature-row .text { font-size: 8.5pt; line-height: 1.35; }
|
||||
.feature-row .text b { color: var(--php-dark); }
|
||||
.feature-row code {
|
||||
font-family: "SF Mono", Consolas, monospace;
|
||||
font-size: 7.5pt;
|
||||
background: var(--bg-soft);
|
||||
padding: 0 1mm;
|
||||
border-radius: 1mm;
|
||||
color: var(--php-dark);
|
||||
}
|
||||
|
||||
/* ===== CODE ===== */
|
||||
.code {
|
||||
background: #1e2a3a;
|
||||
color: #e6e6e6;
|
||||
font-family: "SF Mono", Consolas, monospace;
|
||||
font-size: 7pt;
|
||||
padding: 2.5mm 3mm;
|
||||
border-radius: 1.5mm;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.code .c { color: #6b8aae; font-style: italic; }
|
||||
.code .k { color: #ff79c6; }
|
||||
.code .s { color: #f1c40f; }
|
||||
.code .f { color: #50fa7b; }
|
||||
.code .t { color: #8be9fd; }
|
||||
.code .v { color: #ffb86c; }
|
||||
|
||||
/* ===== ECOSYSTEM ===== */
|
||||
.eco-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1.5mm;
|
||||
}
|
||||
.eco-item {
|
||||
background: var(--bg-soft);
|
||||
border-left: 1.5pt solid var(--php);
|
||||
border-radius: 1mm;
|
||||
padding: 1.5mm 2mm;
|
||||
display: flex; align-items: center; gap: 2mm;
|
||||
}
|
||||
.eco-ico {
|
||||
width: 5mm; height: 5mm; flex-shrink: 0;
|
||||
background: var(--php-dark);
|
||||
border-radius: 50%;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.eco-text { display: flex; flex-direction: column; gap: 0.2mm; }
|
||||
.eco-name { font-weight: 700; font-size: 8pt; color: var(--php-dark); }
|
||||
.eco-desc { font-size: 6.5pt; color: var(--muted); }
|
||||
|
||||
/* ===== TYPE TABLE ===== */
|
||||
.types {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 1.5mm;
|
||||
}
|
||||
.type {
|
||||
background: var(--bg-soft);
|
||||
padding: 1.3mm 2mm;
|
||||
border-radius: 1mm;
|
||||
font-size: 7.5pt;
|
||||
}
|
||||
.type b {
|
||||
font-family: "SF Mono", Consolas, monospace;
|
||||
color: var(--php-dark);
|
||||
display: block;
|
||||
font-size: 8pt;
|
||||
}
|
||||
.type span { color: var(--muted); font-size: 6.8pt; }
|
||||
|
||||
/* ===== SPLIT (composer/comparison) ===== */
|
||||
.split {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 2mm;
|
||||
}
|
||||
.split-col h4 {
|
||||
font-size: 7.5pt;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.4pt;
|
||||
margin-bottom: 1mm;
|
||||
}
|
||||
.split-col.modern h4 { color: var(--php); }
|
||||
.split-col.legacy h4 { color: var(--muted); }
|
||||
.split-col ul { list-style: none; }
|
||||
.split-col li {
|
||||
font-size: 7.5pt;
|
||||
padding-left: 3mm;
|
||||
position: relative;
|
||||
margin-bottom: 0.8mm;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.split-col.modern li::before {
|
||||
content: "+";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
color: var(--php);
|
||||
font-weight: 800;
|
||||
}
|
||||
.split-col.legacy li::before {
|
||||
content: "·";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
color: var(--muted);
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
/* ===== FOOTER ===== */
|
||||
.footer {
|
||||
position: absolute;
|
||||
left: 11mm;
|
||||
right: 11mm;
|
||||
bottom: 9mm;
|
||||
background: var(--php-darker);
|
||||
color: white;
|
||||
padding: 3mm 5mm;
|
||||
border-radius: 1.5mm;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto;
|
||||
gap: 4mm;
|
||||
align-items: center;
|
||||
}
|
||||
.footer-text { font-size: 8.5pt; line-height: 1.45; }
|
||||
.footer-text b { color: var(--accent); }
|
||||
.footer-tag {
|
||||
background: var(--php);
|
||||
color: white;
|
||||
padding: 1.5mm 3mm;
|
||||
border-radius: 1.5mm;
|
||||
font-weight: 800;
|
||||
font-size: 8.5pt;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page">
|
||||
|
||||
<!-- HERO -->
|
||||
<header class="hero">
|
||||
<div class="hero-logo"><div class="hero-logo-box">php</div></div>
|
||||
<div class="hero-text">
|
||||
<h1><span class="accent">PHP</span> – Server-Sprache des Web</h1>
|
||||
<p>Dynamische Webseiten · seit 1995 · 75% aller Websites · objektorientiert & funktional</p>
|
||||
</div>
|
||||
<div class="hero-stats">
|
||||
<div class="stats-row">
|
||||
<div class="stat-cell">
|
||||
<div class="stat-num">8.4</div>
|
||||
<div class="stat-label">Aktuelle Version</div>
|
||||
</div>
|
||||
<div class="stat-cell">
|
||||
<div class="stat-num">1995</div>
|
||||
<div class="stat-label">Erstes Release</div>
|
||||
</div>
|
||||
<div class="stat-cell">
|
||||
<div class="stat-num">75%</div>
|
||||
<div class="stat-label">Aller Websites</div>
|
||||
</div>
|
||||
<div class="stat-cell">
|
||||
<div class="stat-num">300k+</div>
|
||||
<div class="stat-label">Composer-Pakete</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<!-- MAIN GRID -->
|
||||
<main class="grid">
|
||||
|
||||
<!-- ===== SPALTE 1 ===== -->
|
||||
<div class="col">
|
||||
|
||||
<section class="block">
|
||||
<h2>
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<polygon points="12,2 22,8 22,16 12,22 2,16 2,8"/>
|
||||
</svg>
|
||||
Kernkonzepte
|
||||
</h2>
|
||||
<div class="feature-list">
|
||||
<div class="feature-row">
|
||||
<div class="dot">1</div>
|
||||
<div class="text"><b>Server-seitig</b> – läuft auf Webservern, generiert HTML pro Request</div>
|
||||
</div>
|
||||
<div class="feature-row">
|
||||
<div class="dot">2</div>
|
||||
<div class="text"><b>Dynamisch typisiert</b> – Typen zur Laufzeit, optional mit Type-Hints prüfbar</div>
|
||||
</div>
|
||||
<div class="feature-row">
|
||||
<div class="dot">3</div>
|
||||
<div class="text"><b>OOP & funktional</b> – Klassen, Interfaces, Traits, Enums, First-Class-Funktionen</div>
|
||||
</div>
|
||||
<div class="feature-row">
|
||||
<div class="dot">4</div>
|
||||
<div class="text"><b>Composer</b> – moderner Paket-Manager für Dependencies und Autoloading</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="block">
|
||||
<h2>
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<path d="M3 6h18M3 12h18M3 18h18"/>
|
||||
</svg>
|
||||
Datentypen
|
||||
</h2>
|
||||
<div class="types">
|
||||
<div class="type"><b>int</b><span>Ganze Zahlen</span></div>
|
||||
<div class="type"><b>float</b><span>Kommazahlen</span></div>
|
||||
<div class="type"><b>string</b><span>Text in '' oder ""</span></div>
|
||||
<div class="type"><b>bool</b><span>true / false</span></div>
|
||||
<div class="type"><b>array</b><span>Liste oder Map</span></div>
|
||||
<div class="type"><b>object</b><span>Klassen-Instanz</span></div>
|
||||
<div class="type"><b>null</b><span>kein Wert</span></div>
|
||||
<div class="type"><b>callable</b><span>Funktion / Closure</span></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ===== SPALTE 2 ===== -->
|
||||
<div class="col">
|
||||
|
||||
<section class="block">
|
||||
<h2>
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<polyline points="16,18 22,12 16,6"/><polyline points="8,6 2,12 8,18"/>
|
||||
</svg>
|
||||
Hello World
|
||||
</h2>
|
||||
<div class="code"><span class="t"><?php</span><br>
|
||||
<span class="k">declare</span>(strict_types=<span class="s">1</span>);<br>
|
||||
<br>
|
||||
<span class="k">function</span> <span class="f">greet</span>(<span class="t">string</span> <span class="v">$name</span>): <span class="t">string</span> {<br>
|
||||
<span class="k">return</span> <span class="s">"Hallo, </span><span class="v">$name</span><span class="s">!"</span>;<br>
|
||||
}<br>
|
||||
<br>
|
||||
<span class="k">echo</span> <span class="f">greet</span>(<span class="s">'Marek'</span>);<br>
|
||||
<span class="c">// Hallo, Marek!</span></div>
|
||||
</section>
|
||||
|
||||
<section class="block">
|
||||
<h2>
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<path d="M22 12h-4l-3 9L9 3l-3 9H2"/>
|
||||
</svg>
|
||||
Moderne vs. Legacy
|
||||
</h2>
|
||||
<div class="split">
|
||||
<div class="split-col modern">
|
||||
<h4>Modern (8.x)</h4>
|
||||
<ul>
|
||||
<li>strict_types</li>
|
||||
<li>Readonly Properties</li>
|
||||
<li>Enums & Match</li>
|
||||
<li>Named Arguments</li>
|
||||
<li>Promoted Constructor</li>
|
||||
<li>Composer + PSR</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="split-col legacy">
|
||||
<h4>Legacy (5.x)</h4>
|
||||
<ul>
|
||||
<li>magic_quotes</li>
|
||||
<li>register_globals</li>
|
||||
<li>mysql_* Funktionen</li>
|
||||
<li>kein Typ-System</li>
|
||||
<li>include/require Chaos</li>
|
||||
<li>Spaghetti-Code</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- ===== SPALTE 3 ===== -->
|
||||
<div class="col">
|
||||
|
||||
<section class="block">
|
||||
<h2>
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<circle cx="12" cy="12" r="3"/><circle cx="12" cy="12" r="9"/>
|
||||
<line x1="12" y1="3" x2="12" y2="9"/><line x1="12" y1="15" x2="12" y2="21"/>
|
||||
<line x1="3" y1="12" x2="9" y2="12"/><line x1="15" y1="12" x2="21" y2="12"/>
|
||||
</svg>
|
||||
Ökosystem
|
||||
</h2>
|
||||
<div class="eco-grid">
|
||||
<div class="eco-item">
|
||||
<div class="eco-ico"><svg width="2.8mm" height="2.8mm" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3"><polyline points="20,6 9,17 4,12"/></svg></div>
|
||||
<div class="eco-text">
|
||||
<span class="eco-name">Laravel</span>
|
||||
<span class="eco-desc">Full-Stack Framework</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eco-item">
|
||||
<div class="eco-ico"><svg width="2.8mm" height="2.8mm" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3"><polyline points="20,6 9,17 4,12"/></svg></div>
|
||||
<div class="eco-text">
|
||||
<span class="eco-name">Symfony</span>
|
||||
<span class="eco-desc">Enterprise-Framework</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eco-item">
|
||||
<div class="eco-ico"><svg width="2.8mm" height="2.8mm" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3"><polyline points="20,6 9,17 4,12"/></svg></div>
|
||||
<div class="eco-text">
|
||||
<span class="eco-name">Composer</span>
|
||||
<span class="eco-desc">Paket-Manager</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eco-item">
|
||||
<div class="eco-ico"><svg width="2.8mm" height="2.8mm" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3"><polyline points="20,6 9,17 4,12"/></svg></div>
|
||||
<div class="eco-text">
|
||||
<span class="eco-name">PHPUnit</span>
|
||||
<span class="eco-desc">Testing-Framework</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eco-item">
|
||||
<div class="eco-ico"><svg width="2.8mm" height="2.8mm" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3"><polyline points="20,6 9,17 4,12"/></svg></div>
|
||||
<div class="eco-text">
|
||||
<span class="eco-name">PHPStan</span>
|
||||
<span class="eco-desc">Static Analysis</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eco-item">
|
||||
<div class="eco-ico"><svg width="2.8mm" height="2.8mm" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3"><polyline points="20,6 9,17 4,12"/></svg></div>
|
||||
<div class="eco-text">
|
||||
<span class="eco-name">Shopware</span>
|
||||
<span class="eco-desc">E-Commerce-Plattform</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="block">
|
||||
<h2>
|
||||
<svg class="ico" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
|
||||
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/>
|
||||
</svg>
|
||||
Einsatzgebiete
|
||||
</h2>
|
||||
<div class="feature-list">
|
||||
<div class="feature-row">
|
||||
<div class="dot">W</div>
|
||||
<div class="text"><b>Web-Backends</b> – REST/GraphQL APIs, MVC-Apps mit Laravel oder Symfony</div>
|
||||
</div>
|
||||
<div class="feature-row">
|
||||
<div class="dot">C</div>
|
||||
<div class="text"><b>CMS</b> – WordPress, Drupal, TYPO3 für Content-Management</div>
|
||||
</div>
|
||||
<div class="feature-row">
|
||||
<div class="dot">E</div>
|
||||
<div class="text"><b>E-Commerce</b> – Shopware, Magento, WooCommerce</div>
|
||||
</div>
|
||||
<div class="feature-row">
|
||||
<div class="dot">$</div>
|
||||
<div class="text"><b>CLI-Tools</b> – Symfony Console, Laravel Artisan für Automation</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
<!-- FOOTER -->
|
||||
<footer class="footer">
|
||||
<div class="footer-text">
|
||||
<b>Wann PHP wählen?</b> Wenn du schnell ein Web-Backend brauchst, ein riesiges Ökosystem nutzen willst und eine reife Sprache mit großem Talent-Pool suchst. Moderne PHP 8 ist nicht das PHP von 2005.
|
||||
</div>
|
||||
<div class="footer-tag">php.net</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
Reference in New Issue
Block a user