PHP code example of muffin / slug
1. Go to this page and download the library: Download muffin/slug library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
muffin / slug example snippets
public function initialize(array $config): void
{
//etc
$this->addBehavior('Muffin/Slug.Slug', [
// Optionally define your custom options here (see Configuration)
]);
}
// src/Controller/ExamplesController.php
$example = $this->Examples->find('slugged', slug: $slug);
'slugger' => [
'className' => \Muffin\Slug\Slugger\CakeSlugger::class,
'transliteratorId' => '<A valid ICU Transliterator ID here>'
]