zf2helper / aliashelper
Installs: 35
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:zf-module
Requires
- php: >=5.3.3
- doctrine/doctrine-module: >=0.8
- doctrine/doctrine-orm-module: >=0.8
- zendframework/zendframework: >=2.2
This package is auto-updated.
Last update: 2024-10-18 21:34:19 UTC
README
Simple module that creates alias from any text field of the entity.
How does it work:
- Gets from entity field to create alias (title by default).
- Convert field to url friendly alias.
- Searchs entity repository for this alias.
- Adds "-number" if such alias exists.
Usage:
#!php
$entity = new Entity();
$aliasModel = $this->getServiceLocator()->get('AliasHelper');
//$field - entity field that must be converted to alias, title by default
$alias = $aliasModel->getAlias($entity, $field)
$entity->setAlias($alias);