tangoman/truncate-html-bundle

Symfony Truncate Html Twig Extention Bundle

Installs: 246

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

1.0.1 2018-04-08 21:17 UTC

This package is auto-updated.

Last update: 2024-04-16 22:42:04 UTC


README

Tangoman TruncateHtml Twig Service truncates html keeping tags.

How to install

With composer

$ composer require tangoman/truncate-html-bundle

Enable the bundle

Don't forget to enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new TangoMan\TruncateHtml\TangoManTruncateHtml(),
    );
}

You don't have to add TangoMan CallbackBundle to the service.yml of your project. twig.extension.truncate_html service should load automatically.

How to use

Inside your views:

    <p>
        {{ post.html|truncatehtml }}
    </p>

Note

If you find any bug please report here : Issues

License

Copyright (c) 2018 Matthias Morin

License Distributed under the MIT license.

If you like TangoMan TruncateHtml please star! And follow me on GitHub: TangoMan75 ... And check my other cool projects.

tangoman.free.fr