Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nowiko/yii-sluggable-behavior
A simple Yii 1.1 tool for making your app URL's more readable
https://github.com/nowiko/yii-sluggable-behavior
activerecord php slug yii-extension yii-framework
Last synced: 9 days ago
JSON representation
A simple Yii 1.1 tool for making your app URL's more readable
- Host: GitHub
- URL: https://github.com/nowiko/yii-sluggable-behavior
- Owner: nowiko
- License: mit
- Created: 2015-05-23T06:21:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-16T19:07:32.000Z (about 7 years ago)
- Last Synced: 2024-12-23T01:10:06.766Z (11 days ago)
- Topics: activerecord, php, slug, yii-extension, yii-framework
- Language: PHP
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/NovikovViktor/yii-sluggable-behavior/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/NovikovViktor/yii-sluggable-behavior/?branch=master) [![Maintainability](https://api.codeclimate.com/v1/badges/1ff78b18b2d1763a6ced/maintainability)](https://codeclimate.com/github/NovikovViktor/yii-sluggable-behavior/maintainability)
SluggableBehavior
==================================
SluggableBehavior - is a simple tool for making your app URL's more readable.Note: Do not forget to configure 'urlManager' component of your application.
### Basic usage:
1) Download the behavior to your project via git clone or manually as archive.2) Configure your model class according to sample below:
``` php
public function behaviors()
{
return array(
'sluggableBehavior' => array(
'class' => 'path.to.behavior.SluggableBehavior',
'delimiter' => '-', // words delimiter
'sluggable_attr' => 'name', // name of attr what need to be "slugged"
'slug_attr' => 'slug', // attr for store slug
'allow_update' => true, // allow update slug or not
'length' => 5, // length of words to place into slug
),
);
}
```Now you are able to use slug attribute in your URLs.