PHPackages                             sylwesterkowal/plugin.cakephp-slug - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sylwesterkowal/plugin.cakephp-slug

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

sylwesterkowal/plugin.cakephp-slug
==================================

CakePHP Plugin for Slugging

059PHP

Since Sep 11Pushed 9y ago1 watchersCompare

[ Source](https://github.com/SylwesterKowal/plugin.cakephp-slug)[ Packagist](https://packagist.org/packages/sylwesterkowal/plugin.cakephp-slug)[ RSS](/packages/sylwesterkowal-plugincakephp-slug/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Slug plugin for CakePHP 3.x
===========================

[](#slug-plugin-for-cakephp-3x)

Plugin CakePHP to generate friendly URLs. Based on the database allows you to generate simple URL for any data model:
Product Link:
Category Link:

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require sylwesterkowal/plugin.cakephp-slug

```

Install Table
-------------

[](#install-table)

```
cake Migrations migrate -p Slug

```

Configurations
--------------

[](#configurations)

Configuring the plugin is to add the relationship between table Slug and tables in which to use the generated URL slug.

### ModelTable

[](#modeltable)

For example in plugin "Product" for table "ProductsTable.php" add

```
    public function initialize(array $config)
    {

        ...
        ...

        $this->hasOne('Slug.Slugs', [
            'className' => 'Slugs',
            'foreignKey' => 'pass',
            'conditions' => [
                'plugin' => 'Product',  // Set plugin name
                'controller' => 'Products', // Set controller name
                'action' => 'view'  // Set action name
            ]
        ]);

        $this->addBehavior('Slug.Sluggable', [
            'field' => 'name', // enter the field, which will be generated slug
            'plugin' => 'Product', // set plugin name
            'controller' => 'Products', // set controller name
            'action' => 'view', // set action name
            'pass' => 'id',  // set the field, which will by ID Key
        ]);

    }

```

### Routes configuration

[](#routes-configuration)

```
    $routes->connect(
        '/:slug',
        [],
        ['routeClass' => 'Slug.SlugRoute']
    );

```

### Controller

[](#controller)

```
public $helpers = ['Slug.Slug'];

```

### View

[](#view)

In view use SlugHelper. Parameters are require for standard Html-&gt;link url when Slug Plugin for some reason will by offline.

```
echo $this->Slug->link(
    $productEntity,  // Model Entity
    $productEntity->name, // Anchor text
    [ // parameters
        'controller'=>'Products',
        'action'=>'view', $productEntity->id,
        'plugin'=>'Product'
    ]
);

```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/323ae994db57a28d614f774f2e32342e7664db0c7da0d297644e04454d16b09c?d=identicon)[SylwesterKowal](/maintainers/SylwesterKowal)

---

Top Contributors

[![SylwesterKowal](https://avatars.githubusercontent.com/u/20624780?v=4)](https://github.com/SylwesterKowal "SylwesterKowal (37 commits)")

### Embed Badge

![Health badge](/badges/sylwesterkowal-plugincakephp-slug/health.svg)

```
[![Health](https://phpackages.com/badges/sylwesterkowal-plugincakephp-slug/health.svg)](https://phpackages.com/packages/sylwesterkowal-plugincakephp-slug)
```

###  Alternatives

[glenscott/url-normalizer

Syntax based normalization of URL's

101948.9k9](/packages/glenscott-url-normalizer)[clickstorm/cs-seo

\[clickstorm\] SEO - Extension for TYPO3. Enables important onpage features for search engine optimization (SEO). Expands the page settings and any desired records for example with a preview for Google search results (SERP) Structured Data (JSON-LD) and a Focus Keyword. Restrictive hreflang and canonical tags. Modules for metadata of records and alternative texts of images. Further features are shown in the extension manual.

36507.3k1](/packages/clickstorm-cs-seo)[winter/laravel-config-writer

Utility to create and update Laravel config and .env files

16334.1k15](/packages/winter-laravel-config-writer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
