https://github.com/yuehen9/yii2-urlalias
yii2 url alias
https://github.com/yuehen9/yii2-urlalias
seo urlalias yii2
Last synced: 5 months ago
JSON representation
yii2 url alias
- Host: GitHub
- URL: https://github.com/yuehen9/yii2-urlalias
- Owner: yuehen9
- Created: 2017-07-03T14:54:57.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-25T10:08:49.000Z (almost 9 years ago)
- Last Synced: 2024-03-23T20:01:12.145Z (about 2 years ago)
- Topics: seo, urlalias, yii2
- Language: PHP
- Size: 3.91 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
yii2 url alias
==============
like opencart seo url
Installation
------------
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
composer require --prefer-dist caijq4ever/yii2-urlalias "dev-master"
```
or add
```
"caijq4ever/yii2-urlalias": "dev-master"
```
to the require section of your `composer.json` file.
Usage
-----
1.Edit `config/web.php` file
```php
'components' => [
...
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
[
'class' => 'junqi\urlalias\UrlRule',
],
],
],
...
],
```
2.Install migrations `yii migrate/up --migrationPath=@vendor/caijq4ever/yii2-urlalias/migrations`
3.Insert fake data
```SQL
INSERT INTO `url_alias` (`id`, `alias`, `route`, `params`, `status`) VALUES
(1, 'hello', 'site/index', 'a:0:{}', 1),
(2, 'world', 'site/about', 'a:0:{}', 1);
```
4.Run `http://path/to/your/project/hello` on your browser
TODO
----
- Cache
- ...