📜  twig mayusculas (1)

📅  最后修改于: 2023-12-03 15:35:23.341000             🧑  作者: Mango

Introduction to Twig Mayusculas

Twig Mayusculas is a library for the Twig template engine that allows generating text in all uppercase letters. It is particularly useful for generating headings and titles, as well as for emphasizing certain parts of your text.

Installation

Twig Mayusculas can be installed via composer, by running the following command:

composer require pbobios/twig-mayusculas
Usage

Once you have installed Twig Mayusculas, you can start using it in your Twig templates. To do so, you need to add the following code to your Twig environment:

$twig = new Twig_Environment($loader, array(
    'strict_variables' => true,
));

$twig->addExtension(new \Pbob\Twig\Extension\MayusculasExtension());

After that, you can use the mayusculas filter in your templates to generate text in uppercase. For example:

<h1>{{ "This is a heading"|mayusculas }}</h1>

This will output:

<h1>THIS IS A HEADING</h1>
Conclusion

Twig Mayusculas is a simple yet powerful library that can help you generate text in all uppercase letters. It's easy to use and can be a great addition to your Twig toolbox.