2017 © Pedro Peláez
 

library urlify

Port to Laravel4 of jbroadway's PHP port of URLify.js from the Django project. Transliterates non-ascii characters for use in URLs.

image

j0an/urlify

Port to Laravel4 of jbroadway's PHP port of URLify.js from the Django project. Transliterates non-ascii characters for use in URLs.

  • Thursday, April 6, 2017
  • by j0an
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

URLify PHP port for Laravel4

A PHP port of URLify.js from the Django project. Handles symbols from Latin languages, Czech, Greek, Latvian, Lithuanian, Polish, Romanian, Russian, Turkish and Ukrainian. Symbols it cannot transliterate it will simply omit., (*1)

Install:

  • Add "require": { "j0an/urlify": "dev-master" } to composer.json, (*2)

  • Run composer update, (*3)

  • Add to app/config at the bottom of Providers:, (*4)

'j0an\Urlify\UrlifyServiceProvider'

Usage:

To generate slugs for URLs:, (*5)


To simply transliterate characters:, (*6)


To extend the character list:, (*7)

 '?', '®' => '(r)', '¼' => '1/4',
    '¼' => '1/2', '¾' => '3/4', '¶' => 'P'
));

echo j0an\Urlify::downcode ('¿ ® ¼ ¼ ¾ ¶');
// "? (r) 1/2 1/2 3/4 P"

?>

To extend the list of words to remove:, (*8)


To priorize a certain language map:, (*9)


Please note that the "ü" is transliterated to "ue" in the first case, whereas it results in a simple "u" in the latter., (*10)

The Versions

06/04 2017

dev-master

9999999-dev https://github.com/j0an/urlify

Port to Laravel4 of jbroadway's PHP port of URLify.js from the Django project. Transliterates non-ascii characters for use in URLs.

  Sources   Download

MIT

The Requires

 

laravel url link encode translit slug urlify transliteration iconv transliterate