Closed WebVPF closed 7 months ago
column
country_name
currency_name
currency_symbol
data_uri
filter
format_currency
format_date
format_datetime
format_number
format_time
inline_css
json_encode
language_name
locale_name
map
reduce
timezone_name
html_to_markdown
inky_to_html
markdown_to_html
spaceless
Examples of code from the documentation for verification:
{% set fruits = items|column('fruit') %} {{ 'FR'|country_name }} {{ 'US'|country_name('fr') }} {{ 'EUR'|currency_name }} {{ 'JPY'|currency_name('fr_FR') }} {{ 'EUR'|currency_symbol }} {{ 'JPY'|currency_symbol('fr') }} {{ image_data|data_uri }} {{ image_data|data_uri(mime="image/svg") }} {{ sizes|filter(v => v > 38) }} {{ '1000000'|format_currency('EUR') }} {{ '2019-08-07 23:39:12'|format_date() }} {{ '2019-08-07 23:39:12'|format_datetime() }} {{ '2019-08-07 23:39:12'|format_time() }} {{ '12.345'|format_number }} {{ '12.345'|format_number({rounding_mode: 'floor'}) }} {{ include('some_template.html.twig')|html_to_markdown }} {{ include('some_template.inky.twig')|inky_to_html }} {{ include('some_template.html.twig')|inline_css }} {{ include('some_template.html.twig')|inline_css(source("some_styles.css")) }} {{ data|json_encode() }} {{ 'de'|language_name }} {{ 'de'|language_name('fr') }} {{ 'de'|locale_name }} {{ 'de'|locale_name('fr') }} {{ people|map(p => "#{p.first} #{p.last}")|join(', ') }} {{ changelog|markdown_to_html }} {{ numbers|reduce((carry, v, k) => carry + v * k) }} {{ "<div> <strong>foo</strong> </div> "|spaceless }} {{ 'Europe/Paris'|timezone_name }} {{ 'America/Los_Angeles'|timezone_name('fr') }} {{ "path-seg*ment"|url_encode }}
Thanks again, @WebVPF! :)
With parameters:
column
- https://twig.symfony.com/doc/3.x/filters/column.htmlcountry_name
- https://twig.symfony.com/doc/3.x/filters/country_name.htmlcurrency_name
- https://twig.symfony.com/doc/3.x/filters/currency_name.htmlcurrency_symbol
- https://twig.symfony.com/doc/3.x/filters/currency_symbol.htmldata_uri
- https://twig.symfony.com/doc/3.x/filters/data_uri.htmlfilter
- https://twig.symfony.com/doc/3.x/filters/filter.htmlformat_currency
- https://twig.symfony.com/doc/3.x/filters/format_currency.htmlformat_date
- https://twig.symfony.com/doc/3.x/filters/format_date.htmlformat_datetime
- https://twig.symfony.com/doc/3.x/filters/format_datetime.htmlformat_number
- https://twig.symfony.com/doc/3.x/filters/format_number.htmlformat_time
- https://twig.symfony.com/doc/3.x/filters/format_time.html#format-timeinline_css
- https://twig.symfony.com/doc/3.x/filters/inline_css.htmljson_encode
- https://twig.symfony.com/doc/3.x/filters/json_encode.htmllanguage_name
- https://twig.symfony.com/doc/3.x/filters/language_name.htmllocale_name
- https://twig.symfony.com/doc/3.x/filters/locale_name.htmlmap
- https://twig.symfony.com/doc/3.x/filters/map.htmlreduce
- https://twig.symfony.com/doc/3.x/filters/reduce.htmltimezone_name
- https://twig.symfony.com/doc/3.x/filters/timezone_name.htmlNo parameters:
country_name
currency_name
currency_symbol
data_uri
format_number
html_to_markdown
- https://twig.symfony.com/doc/3.x/filters/html_to_markdown.htmlinky_to_html
- https://twig.symfony.com/doc/3.x/filters/inky_to_html.htmlinline_css
language_name
locale_name
markdown_to_html
- https://twig.symfony.com/doc/3.x/filters/markdown_to_html.htmlspaceless
- https://twig.symfony.com/doc/3.x/filters/spaceless.htmltimezone_name
Examples
Examples of code from the documentation for verification: