unimatrix / frontend
此包已被废弃,不再维护。未建议替代包。
CakePHP 3.6 的前端
3.2.0
2018-06-21 15:16 UTC
Requires
- unimatrix/cake: ^3.0
Requires (Dev)
- phpunit/phpunit: ^5.7.14|^6.0
- symfony/var-dumper: ~2.7|~3.0|~4.0
README
CakePHP 3.6 的前端
要求
- PHP >= 7.1
- CakePHP >= 3.6
安装
您可以使用 composer 将此插件安装到您的 CakePHP 应用程序中。
安装 composer 包的推荐方式是
composer require unimatrix/frontend:^3.0
不要忘记在 Application.php
的 bootstrap 函数中加载它
$this->addPlugin('Unimatrix/Cake');
$this->addPlugin('Unimatrix/Frontend');
配置
当然,您必须在 config/app.php
中添加一些内容
/**
* Frontend settings
*
* - security - Enables security modules, if ssl is set to true frontend wont load without https
* - seo - Default SEO values (can be overwritten on a template basis), publishers.facebook should be appid
* - cookie - The default info for the (mandatory by EU) cookie message
*/
'Frontend' => [
'security' => [
'enabled' => true,
'ssl' => false,
'skip' => [ // skip CSRF verifications for these requests
['controller' => 'API', 'action' => 'batch'], // skip the batch action from the API controller
['controller' => 'Amazon'], // skip the whole amazon controller
['plugin => 'Backend'] // skip the whole backend plugin
]
],
'seo' => [
'site' => 'Website.tld',
'theme' => '#ffffff',
'title' => 'Website Title',
'keywords' => 'website, title',
'description' => 'The website description.',
'publishers' => [
'facebook' => '1111111111111111', // app id
'google' => 'https://plus.google.com/Website',
]
],
'captcha' => [ // google recaptcha widget
'key' => 'your site key',
'secret' => 'your secret key'
],
'cookie' => [
'url' => '/cookies', // or array ['controller' => 'Pages', 'action' => 'cookies']
]
],