dzango / twig-truncate-bundle
A Symfony bundle to include the TwigTruncateExtension into your app.
Installs: 18 666
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.3
- dzango/twig-truncate-extension: ^1.0
- symfony/framework-bundle: ^2.0 || ^3.0 || ^4.0 || ^5.0
This package is auto-updated.
Last update: 2024-11-04 20:30:12 UTC
README
A Symfony bundle to include the TwigTruncateExtension into your app. The TwigTruncateExtension allows you to truncate text while preserving HTML tags.
Installation
Add the bundle to your app's composer.json
:
"require": { "dzango/twig-truncate-bundle": "^1.0", ... }
Enable the bundle in your app's Appkernel
(Only for symfony projects below 4):
# app/AppKernel.php class AppKernel extends Kernel { public function registerBundles() { $bundles = array( ... new Dzango\Bundle\TwigTruncateBundle\TwigTruncateBundle(), ... );
Note:
For symfony 4 and above the bundle will automatically enabled in your app. In case the bundle does not enabled, add it to bundle list.
#config/bundles.php return [ ... Dzango\Bundle\TwigTruncateBundle\TwigTruncateBundle::class => ['all' => true], ]
Usage
See the TwigTruncateExtension's documentation.