Skip to content

Commit

Permalink
Update 3-Templates.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Jan 17, 2025
1 parent 8e253a2 commit ccb3ab5
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion docs/3-Templates.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!--
description: "Working with layouts and templates."
date: 2021-05-07
updated: 2024-01-18
updated: 2025-01-17
alias: documentation/layouts
-->
# Templates
Expand Down Expand Up @@ -1226,6 +1226,29 @@ Supported values are: `short`, `medium`, `long`, and `full`.
If you want to use the `format_date` filter **with other locales than "en"**, you should [install the intl PHP extension](https://php.net/intl.setup).
:::

## Components

Cecil provides a components logic to help you build your templates.

```twig
{# /components/button.twig #}
<button {{ attributes.merge({class: 'rounded px-4'}) }}>
{{ slot }}
</button>
{# /index.twig #}
{% x:button with {class: 'text-white'} %}
<strong>Click me</strong>
{% endx %}
{# Rendered #}
<button class="text-white rounded px-4">
<strong>Click me</strong>
</button>
```

See official _Twig components extension_ documentation: <https://github.com/giorgiopogliani/twig-components#readme>.

## Built-in templates

Cecil comes with a set of [built-in templates](https://github.com/Cecilapp/Cecil/tree/master/resources/layouts).
Expand Down

0 comments on commit ccb3ab5

Please sign in to comment.