icybee / module-sites
管理网站
v3.0.0
2017-03-05 12:06 UTC
Requires
- php: >=5.5
- icanboogie/module-installer: ^1.2
- icybee/core: ^3.0
- icybee/module-registry: ^3.0
README
网站模块(sites
)管理由Icybee提供的网站。
事件钩子
ICanBoogie\Core::run
初始化核心对象的site
、locale
和timezone
属性。如果网站有基本路径,则修补Routing包的contextualize()
和decontextualize()
辅助函数。
ICanBoogie\HTTP\RequestDispatcher::dispatch:before
如果请求不匹配任何网站,则将请求重定向到第一个可用的网站。
原型方法
Icybee\Modules\Nodes\Node::get_site
返回节点所属的网站。
<?php $app->models['nodes']->one->site;
ICanBoogie\Core::get_site
返回与当前请求匹配的网站。
<?php $app->site; # or $app->request->context->site;
ICanBoogie\Core::get_site_id
返回与当前请求匹配的网站的标识符。
<?php $app->site_id; # or $app->request->context->site_id;
ICanBoogie\HTTP\Request\Context::get_site
返回与请求上下文匹配的网站。
<?php $app->request->context->site;
ICanBoogie\HTTP\Request\Context::get_site_id
返回与请求上下文匹配的网站的标识符。
<?php $app->request->context->site_id;
需求
该包需要PHP 5.5或更高版本。
安装
安装此包的推荐方法是使用Composer。
$ composer require icybee/module-sites
克隆仓库
该包可在GitHub上找到,其仓库可以使用以下命令行克隆
$ git clone https://github.com/Icybee/module-sites.git sites
文档
该包作为Icybee CMS 文档的一部分进行文档记录。可以使用make doc
命令生成该包及其依赖项的文档。文档使用ApiGen在docs
目录中生成。可以使用make clean
命令清理包目录。
测试
使用make test
命令运行测试套件。将自动安装Composer以及运行套件所需的所有依赖项。可以使用make clean
命令清理包目录。
该包由Travis CI持续测试。
许可
该模块受新BSD许可协议的许可 - 有关详细信息,请参阅LICENSE文件。