2017 © Pedro Peláez
 

library silex-autolink

Simple Twig extension for Silex to add autolink filter

image

nicl/silex-autolink

Simple Twig extension for Silex to add autolink filter

  • Friday, October 19, 2012
  • by nicl
  • Repository
  • 1 Watchers
  • 6 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 3 Open issues
  • 1 Versions
  • 6 % Grown

The README.md

Silex-Autolink

A lightweight service provider for Silex which adds an autolink Twig extension., (*1)

Identifying URLs in strings is not easy. This is a rough and pragmatic first attempt. Feedback is welcome!, (*2)

Useful information on autolinking can be found in this article by Martin Fowler (also check out the numerous comments) and also in the book Mastering Regular Expressions by Jeffrey Friedl., (*3)

Installation

Recommended installation is through composer. Just add the following to your composer.json file:, (*4)

{
    "require": {
        "nicl/silex-autolink": "1.0.*"
    }
}

Usage

To use the service provider first register it:, (*5)

$app->register(new AutolinkServiceProvider());

You can then use the autolink filter in Twig files. For example:, (*6)

{{ 'Check out this site: http://example.com'|autolink }}

Tests

If you wish to run the tests you need to have PHPUnit installed. Then, from the silex-autolink root directory run:, (*7)

phpunit

(You may need to adapt the phpunit command and paths depending on your configuration.), (*8)

The Versions

19/10 2012

dev-master

9999999-dev http://github.com/nicl/silex-autolink

Simple Twig extension for Silex to add autolink filter

  Sources   Download

MIT

The Requires

 

by Nicolas Long