Yii 2 - Manage slugs with Yii 2 Framework
- create, update, delete slug
- map route with controller/action (in testing)
- interface for manage slug
- Install Yii 2 using your preferred method
- Enable rewrite_url http://www.yiiframework.com/doc-2.0/guide-tutorial-shared-hosting.html
- Install package via composer
"cultivonsleweb/yii2-slug": "dev-master"
(not enable for moment) - Update config file config/web.php and config/db.php
// app/config/web.php
return [
'aliases' => [
'@cultivonsleweb/yii2/slug' => '@vendor/cultivonsleweb/yii2-slug',
],
'components' => [
// NOTE: in the yii2-advanced-app, the user component should be updated in
// 'frontend/config/main.php' and/or 'backend/config/main.php' (OR you can add it
// to 'common/config' if you remove it from frontend/backend)
'urlManager' => [
'enablePrettyUrl' => true, // Disable r= routes
'showScriptName' => false, // Disable index.php
'enableStrictParsing' => true,
'class' => 'cultivonsleweb\yii2\slug\components\SlugUrlManager',
],
],
];
// app/config/db.php
return [
'class' => 'yii\db\Connection',
// set up db info
];
- Run migration file
php yii migrate --migrationPath=@vendor/cultivonsleweb/yii2-slug/migrations
The MIT License (MIT)
Copyright (c) 2015 Cultivons le web
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.