Includes

Includes allow injecting reusable components into existing DOM elements.

---

1. Basic Include


$tpl->include('#header', 'header');
---

2. Include with Data


$header = $tpl->include('#header', 'header');
$header->pick('username')->content('Tamil');
---

3. Include with Path


$tpl->include('#header', 'header', 'components');
---

4. Include Inside Loop


$item = $tpl->addLoopItem('users');

$card = $item->include('#card', 'user-card');
$card->pick('name')->content('John');
---

5. Include Inside Slot

Works seamlessly with nested layouts.

---

6. Selector Rules

---

7. Common Mistakes

❌ Selector matches multiple elements
❌ Selector not found
❌ Using generic selectors (.class)
❌ Reusing same include target
---

8. Best Practices

---
Includes act like reusable components.