olliebrennan / zf2-slug-generator
There is no license information available for the latest version (dev-master) of this package.
A ZF2 Slug Generation Library. Allows basic slug generation or integration with your DB
dev-master
2013-10-27 10:02 UTC
Requires
- php: >=5.3.3
- zf-commons/zfc-base: dev-master
This package is not auto-updated.
Last update: 2025-03-11 03:43:31 UTC
README
Zf2SlugGenerator
A simple module that creates slugs.
If required, the slug generator ties into the DB adapter if required.
Installation
- Add the following requirement to your projects composer.json file.
Within the "repositories" section (create it as below if it doesn't exist):
Within the "require" section:
"olliebrennan/zf2-slug-generator": "dev-master"
- Open up your command line and run
php ./composer.phar update
- Add 'Zf2SlugGenerator' to your /config/application.config.php modules
Usage Example
Creating a basic slug
$service = $this->getServiceLocator()->get('Zf2SlugGenerator\SlugService');
$slug = $service->create('My String To Slug', false);
Calling a slug using your existing DB adapter
$service = $this->getServiceLocator()->get('Zf2SlugGenerator\SlugService')
->setDbTableName('tableName')
->setDbColumnName('columnName');
$slug = $service->create('My String To Slug');