unimatrix / backend
此包已废弃,不再维护。未建议替代包。
CakePHP 3.6 的后端
3.2.0
2018-06-22 17:37 UTC
Requires
- unimatrix/cake: ^3.0
- unimatrix/ckfinder: ^3.0
Requires (Dev)
- phpunit/phpunit: ^5.7.14|^6.0
- symfony/var-dumper: ~2.7|~3.0|~4.0
This package is not auto-updated.
Last update: 2022-04-30 14:50:59 UTC
README
CakePHP 3.6 的后端
需求
- PHP >= 7.1
- CakePHP >= 3.6
安装
您可以使用 composer 将此插件安装到您的 CakePHP 应用程序中。
安装 composer 包的推荐方式是
composer require unimatrix/backend:^3.0
别忘了在 Application.php
中的 bootstrap 函数下加载它
$this->addPlugin('Unimatrix/Cake');
$this->addPlugin('Unimatrix/Backend');
配置
当然,您需要在 config/app.php
中添加一些内容
/**
* Backend settings
*
* - security - Enables security modules, if ssl is set to true backend wont load without https
* - credentials - The backend auth credentials that will allow you to login
* - ckfinder - License information for ckfinder and backend settings (only local or ftp supported)
* - http://docs.cksource.com/ckfinder3-php/configuration.html#configuration_options_backends
*/
'Backend' => [
'security' => [
'salt' => '....64characters....', // optional to encrypt backend cookies automatically
'enabled' => true,
'ssl' => false
],
'credentials' => [
'username' => 'user',
'password' => 'pass',
'cookie' => 'backend_credentials_remember' // optional cookie autologin name
],
'ckfinder' => [
'license' => 'your-license',
'key' => 'your-license-key',
'tmp' => TMP,
'backend' => [
'name' => 'default',
'adapter' => 'local',
'baseUrl' => '/up/',
'root' => WWW_ROOT . 'up',
'chmodFiles' => 0777,
'chmodFolders' => 0755,
'filesystemEncoding' => 'UTF-8'
]
],
'whitelabel' => [
'product' => 'Unimatrix Venture Digital Platform System',
'website' => 'https://venture.unimatrix.ro'
]
],
使用方法
要使用后端插件,您需要在 config/routes.php
中添加一个前缀
登录由插件处理,但其余的控制器/模块可以在您的应用程序的 src/controller/backend 下
// backend
Router::prefix('backend', function(RouteBuilder $routes) {
$routes->connect('/', ['controller' => 'Dashboard', 'action' => 'index']);
});