, (*1)
Zf2SlugGenerator
A simple module that creates slugs., (*2)
If required, the slug generator ties into the DB adapter if required., (*3)
Installation
1) Add the following requirement to your projects composer.json file., (*4)
Within the "repositories" section (create it as below if it doesn't exist):, (*5)
Within the "require" section:, (*6)
"olliebrennan/zf2-slug-generator": "dev-master"
2) Open up your command line and run, (*7)
php ./composer.phar update
2) Add 'Zf2SlugGenerator' to your /config/application.config.php modules, (*8)
Usage Example
Creating a basic slug, (*9)
$service = $this->getServiceLocator()->get('Zf2SlugGenerator\SlugService');
$slug = $service->create('My String To Slug', false);
Calling a slug using your existing DB adapter, (*10)
$service = $this->getServiceLocator()->get('Zf2SlugGenerator\SlugService')
->setDbTableName('tableName')
->setDbColumnName('columnName');
$slug = $service->create('My String To Slug');