定制 dlds/yii2-urlias 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dlds/yii2-urlias

最新稳定版本:0.4

Composer 安装命令:

composer require dlds/yii2-urlias

包简介

Yii2 url alias

README 文档

README

Installation

1. Install Repository

You can install via composer.

Run

php composer.phar require --prefer-dist "fg/yii2-url-alias" "dev-master"

or add to require section of composer.json:

"fg/yii2-url-alias": "dev-master"

2. Edit your config files

#####2.1. Check Database Connection Params Check your config/db.php file. Have correct parameters? #####2.2. Install migrations php yii migrate/up --migrationPath=@vendor/fg/yii2-url-alias/migrations

If you want example data, run this queries:

INSERT INTO `url_rule` (`id`, `slug`, `route`, `params`, `status`) VALUES
(1, '', 'site/index', 'a:0:{}', 1),
(2, 'about', 'site/about', 'a:0:{}', 1),
(3, 'contact', 'site/contact', 'a:0:{}', 1),
(4, 'login', 'site/login', 'a:0:{}', 1),
(5, 'logout', 'site/logout', 'a:0:{}', 1);

#####2.3. Edit config/web.php: file

/** Example urlManager config */
'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName'  => false,
            'rules' => [
                [
                    'class' => 'dlds\urlias\components\BaseUrlRule',
                    'connectionID'  => 'db',
                    'redirect301'   => true //if you want 301 redirect
                ]
                ...
            ]
        ],

#####2.4 Test http://YOUR_LOCAL_SERVER/about

统计信息

  • 总下载量: 32
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: new
  • 更新时间: 2015-03-13