dev-master
9999999-dev https://github.com/martyshka/SeoUrlModule converts any string to valid URL
MIT
The Requires
- php >=5.3.0
- zendframework/zendframework 2.*
url zf2 seo slug
Module converts any string to valid URL
Simple ZF2 SEO Url generator. Module converts strings to valid Urls. For example:
I'm starting a new project – which version of Zend Framework should I use?
will be converted to
im-starting-a-new-project-which-version-of-zend-framework-should-i-use
. SEO Url Module works also with non latin characters., (*1)
For string convertation I'm using part of CodeIgniter's helper url_title()., (*2)
For the installation uses composer composer. Add this project in your composer.json:, (*3)
"require": { "cyrkulewski/seo-url": "dev-master" }
Configuration:
- Add the module of config/application.config.php
under the array modules
, insert SeoUrl
.
- Copy a file named seourl.global.php.dist
to config/autoload/
and change name to seourl.global.php
.
- Modify config to fit your expectations., (*4)
$slug = $this->getServiceLocator()->get('SeoUrl\Slug'); echo $slug->create("I'm starting a new project – which version of Zend Framework should I use?");
By default SEO Url use parameters defined in config/autoload/seourl.global.php
. But one might need to use different setup in different places around the code. In this case one can overwrite default confid parameters., (*5)
$slug = $this->getServiceLocator()->get('SeoUrl\Slug'); $slug->setMinLength(10); $slug->setMaxLength(100); $slug->setSeparator('_'); $slug->setStringEncoding('UTF-16'); $slug->setForeignChars(array('/я/' => 'ja')); echo $slug->create("I'm starting a new project – which version of Zend Framework should I use?");
Aleksander Cyrkulewski - cyrkulewski@gmail.com, (*6)
Module converts any string to valid URL
MIT
url zf2 seo slug