Yii2 Under Construction Module
, (*1)
The simple yii2 extension which can disallow access to website., (*2)
Installation
Via composer:, (*3)
composer require "mervick/yii2-under-construction" "~1.0"
Usage
Add to your config.php
:, (*4)
return [
// ...
'modules' => [
'under-construction' => [
'class' => '\mervick\underconstruction\Module',
// this is the on off switch
'locked' => true,
// the list of IPs that are allowed to access site.
// The default value is `['127.0.0.1', '::1']`, which means the site can only be accessed by localhost.
'allowedIPs' => ['127.0.0.1', '::1'],
// change this to your namespace, if you want use your own controller
'controllerNamespace' => 'mervick\underconstruction\controllers',
// if you want use your views
'viewPath' => '@alias/to/viewPath',
// default layout
'layout' => 'main',
// if you want redirect to external website, default is null
'redirectURL' => 'http://example.com',
],
],
'bootstrap' => [
'under-construction',
],
];
Preview
, (*5)
License
BSD3-Clause, (*6)