<?php
/**
* ========================================
* 📦 Další praktické OOP koncepty (krátce)
* ========================================
*/
// ============================================================================
// 1. 📦 DTO (Data Transfer Objects) - Typované přenosy dat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // ============================================================================ | |
| // FOTBALISTA - Entita | |
| // ============================================================================ | |
| class Player | |
| { | |
| private string $name; | |
| private int $age; |
<?php
/**
* ========================================
* 🔒 IMMUTABLE OBJECTS - Kompletní průvodce
* ========================================
*/
// ============================================================================
// CO TO JE?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| https://play.tailwindcss.com/V4B6tDWkg1 | |
| --> | |
| <div class="[--color:red] md:[--color:green]"> | |
| <div class="aspect-square w-20 bg-[var(--color)]">1</div> | |
| <div class="aspect-square w-20 bg-[--color]">2</div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Domain; | |
| class Card | |
| { | |
| public CardSuit $suit; | |
| public CardRank $rank; | |
| public function __construct(CardSuit $suit, CardRank $rank) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* https://www.bitovi.com/blog/css-only-type-grinding-casting-tokens-into-useful-values */ | |
| @property --variant { | |
| syntax: "primary|secondary|success|error"; | |
| initial-value: primary; | |
| inherits: true; | |
| } | |
| @property --_v-primary-else-0 { | |
| syntax: "primary|<integer>"; initial-value: 0; inherits: true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://play.tailwindcss.com/jkUSFtwsv3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://medium.com/@ThinkingLoop/12-dom-tricks-no-libraries-required-61268e398c50 | |
| // 1) Query once, act many | |
| const $ = (sel, root = document) => root.querySelector(sel); | |
| const $$ = (sel, root = document) => [...root.querySelectorAll(sel)]; | |
| const app = $('#app'); | |
| const buttons = $$('.action', app); | |
| buttons.forEach(btn => btn.addEventListener('click', onAction)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* 1. Define the order of all layers */ | |
| @layer reset, base, library, components, utilities, overrides; | |
| /* 2. Place different styles into corresponding layers */ | |
| /* reset.css or normalize.css */ | |
| @layer reset { | |
| /* ...reset the browser's default styles... */ | |
| * { box-sizing: border-box; } | |
| } |
NewerOlder