hsynlms / url-record
a simple slug generator
Installs: 1 138
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=7.4
This package is not auto-updated.
Last update: 2025-07-23 16:42:52 UTC
README
A simple slug generator. It's a PHP port from nopCommerce UrlRecord service.
Why php-url-record?
The reason behind this repository is nopCommerce, is an open source ASP.NET Core based ecommerce solution. I just wanted to create a port of the nopCommerce SEO friendly slug generation service which is in production for years and trusted by tens of thousands of stores.
Install
$ composer require hsynlms/url-record
Usage
use hsynlms\UrlRecord; $slugGenerator = new UrlRecord(); echo $slugGenerator->GetSeoFriendlyName('nobodY d0es_it better'); // will return -> nobody-d0es_it-better
Options
Name | Type | Default | Description |
---|---|---|---|
name | string | - | The string that will be slugified |
convertNonWesternChars | boolean | true | A value indicating whether non western chars should be converted |
allowUnicodeCharsInUrls | boolean | false | A value indicating whether Unicode chars are allowed |
Compatibility
PHP 7 >= 7.4.0 required due to use of built-in mb_str_split function.