Testing Twig

Testing Twig functions


    config('app.locale') → en

    env('APP_ENV', 'production') → local

    this.session.get('_token') → zWPvWD6SGyP90RS6j8ie0IRum2yZzsE6z3ZCvMy7

    carbon('now') → 2026-07-04 00:17:26

    carbon('now').formatLocalized('%d de %B, %Y') → 04 July 04e 2026

    carbon('yesterday').diffForHumans() → 1 day ago

    carbon('now').format('m.d.y.H.i.s') → 07.04.26.00.17.26

    now|date('d F \\d\\e Y') → 03 July de 2026
    

Testing Twig filters


    'I love programming.'|trans → I love programming.

    'Jack'|str_upper → JACK

    'JACK'|str_lower → jack

    'best '|str_repeat(3) → best best best 

    'mail'|str_plural(1) → mail

    'mail'|str_plural(2) → mails

    "Hello World!"|str_limit(5) → Hello...

    'xxx'|str_pad_both(7, 'o') → ooxxxoo

    'octobercms@gmail.tld'|html_mailto → octobercms@gmail.tld

    'October CMS'|str_replace('CMS', 'ERP') → October ERP

    <p><strong>Test</strong></p>'|html_strip('<p>') → <p>Test</p>
    

Testing Twig dump

Array variables
_token string
"zWPvWD6SGyP90RS6j8ie0IRum2yZzsE6z3ZCvMy7"
array:1 [
  "_token" => "zWPvWD6SGyP90RS6j8ie0IRum2yZzsE6z3ZCvMy7"
]
array:1 [
  "foo" => "bar"
]

Testing custom extension

Hello John Hurry up it is: 07/03/2026

Testing collect function

Testing mail obfuscation

octobercms@gmail.tld

Test

Testing expressions

Collection is empty

Array is empty