Skip to content

vasildb/unique-url-alias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Unique URL Alias

Convert a text to a url-friendly text, plus check for the uniqueness of it.

Usage

    $alias = UrlHelper::alias('My Post Name', function($alias) {
        /*
        * A function which queries the database and gets
        * the users' count which match the alias.
        * If the count is positive, means there are already rows
        * with the current alias, so the function returns false,
        * otherwise returns true.
        * Change the code below with your own checking mechanism.
        */
        return !(bool)DB::Model_User::getByAlias($alias)->count();
    });

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages