Developed with love by KnpLabs Hire us for your project!
49

LiipUrlAutoConverterBundle

by liip

This bundle will add a Twig Extension for templates with a new filter for automatically converting urls and emails in a string to html links

LiipUrlAutoConverterBundle

Latest Stable Version
Latest Unstable Version
Total Downloads
Build Status

About

This bundle adds a Twig Extension with a filter for automatically converting urls and emails in a string to html links.
In the Format: "liip.ch" for urls or "info@liip.ch" for emails.

Installation

  1. Add this bundle to your composer.json:

    $ php composer.phar require liip/url-auto-converter-bundle:dev-master
    
  2. Add this bundle to your application's kernel:

    // application/ApplicationKernel.php
    public function registerBundles()
    {
      return array(
          // ...
          new Liip\UrlAutoConverterBundle\LiipUrlAutoConverterBundle(),
          // ...
      );
    }
    

Configuration

The supported options for the LiipUrlAutoConverterBundle are: (put in /app/config/config.yml)

liip_url_auto_converter:
    linkclass:
    target: _blank
    debugmode: false
  • "linkClass": css class thath will be added automatically to converted links. default: "" (empty)
  • "target": browser link target. default: "_blank"
  • "debugMode": if true, links will be colored with a nasty green color - cool for testing. default: false

All settings are optional.

Usage

This library adds a filter for twig templates that can be used like:

{{ "sometexttofindaurl www.liip.ch inside" | converturls }}

License

See LICENSE.

Copyright (c) 2011 Liip AG

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
liip_url_auto_converter:
linkclass:
target: _blank
debugmode: false
  • tweaked test matrix
    By lsmith77, 2 years ago
  • Merge pull request #20 from Nyholm/patch-1
    By lsmith77, 3 years ago
  • Added PHP 5.6 and HHVM to travis.yml
    By Nyholm, 3 years ago
  • notify slack
    By lsmith77, 3 years ago
  • add version badges to readme.
    By dbu, 3 years ago
  • Merge pull request #18 from thomasthiry/master
    By dbu, 3 years ago
  • Fixed bug with url with parameters introduced in previous commit
    By , 3 years ago
  • Added version 1.1.0 and added tests for special chars and parentheses
    By dbu, 3 years ago
  • added support for parentheses and accents in url locations
    By dbu, 3 years ago
  • Merge pull request #17 from liip/security-fix
    By dbu, 3 years ago
  • reduce number of travis builds
    By dbu, 3 years ago
  • pre_escape html to prevent injection and adding functional test for twig escaping
    By dbu, 3 years ago
  • Merge pull request #9 from weaverryan/patch-1
    By dbu, 4 years ago
  • Updating README - simply removing one unnecessary step :)
    By weaverryan, 4 years ago
  • Merge pull request #8 from liip/fix_query_string_handling
    By lsmith77, 4 years ago
  • fix edge case issue with query strings
    By lsmith77, 4 years ago
  • tweaked travis setup
    By lsmith77, 4 years ago
  • and another one
    By lsmith77, 4 years ago
  • another format fix
    By lsmith77, 4 years ago
  • format fix
    By lsmith77, 4 years ago
  • updated install instructions
    By lsmith77, 4 years ago
  • updated requirements
    By lsmith77, 4 years ago
  • Merge pull request #6 from artur-gajewski/master
    By lsmith77, 4 years ago
  • Ignore period, comma and question mark from the very end of URL if its last character of it
    By artur-gajewski, 4 years ago
  • Merge pull request #5 from busi/master
    By lsmith77, 4 years ago
  • Update composer.json
    By busi, 4 years ago
  • Merge pull request #3 from jenkoian/branch-alias
    By lsmith77, 4 years ago
  • Provide branch alias
    By jenkoian, 4 years ago
  • use the composer installer
    By lsmith77, 5 years ago
  • fix framework bundle sep
    By lsmith77, 5 years ago