<?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 | |
| $regex1 = '/(\d+) \1/'; // Backreference | |
| $regex2 = '/(\d+) (?1)/'; // Subroutine | |
| 100 100 // ✅ only backreference | |
| 100 200 // ✅ both! | |
| // https://github.com/Hamz-a/php-regex-best-practices/blob/master/07%20Writing%20modular%20regexes.md |
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
| // useFormHandler.js | |
| import { ref } from 'vue' | |
| export function useFormHandler(initialData = {}) { | |
| const formData = ref({ ...initialData }) | |
| const errors = ref({}) | |
| const validate = () => { | |
| errors.value = {} | |
| Object.keys(formData.value).forEach(key => { | |
| if (!formData.value[key]) errors.value[key] = 'Required' |
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://jsbin.com/qonusuciru/6/edit?html,css,output |
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
| _ |
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://jsbin.com/hegesunoyu/3/edit?html,css,output |
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] Card List */ | |
| https://codepen.io/kevinpowell/pen/RwvWoLg | |
| /* [2] Two list side by side with unlimited rows and same height on each row */ | |
| https://codepen.io/kevinpowell/pen/KKqjrRO |
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://codepen.io/gwaradon/pen/poYYbPY --> | |
| <div class="w-500"> | |
| <div class="grid"> | |
| <div class="grid-item"> | |
| Gird item 1 | |
| </div> | |
| <div class="grid-item"> | |
| Gird item 2 |
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; |
NewerOlder