annotate/themes
Composer 安装命令:
composer require annotate/themes
包简介
Themes support for Annotate Framework
README 文档
README
Themes package for Annotate Framework
This package provides powerfull themes support. You can create theme and override every template in theme.
Requirements
Themes extension requires annotate/templating. Register its extension to your neon config too.
Installation
Require this extension by Composer
$ composer require annotate/themes:~2.1.0
Register extension into configuration:
extensions: templating: Annotate\Templating\DI\TemplatingExtension themes: Annotate\Themes\DI\ThemesExtension
Configure
Themes path is configurable via Neon. Default directory value is %appDir%/app/addons/themes/.
To change themes open app/config/app.neon and add following configuration:
themes:
directory: %appDir%/app/
Now edit any of your presenters:
class FrontendPresenter extends Nette\Application\UI\Presenter
{
use Annotate\Themes\ThemedPresenter;
/** @var Annotate\Themes\Loaders\ThemesLoader @inject */
public $themesLoader;
public function startup()
{
parent::startup();
$this->themesLoader->activateTheme('theme name');
}
}
Create theme
Create a file theme_name.theme.neon in themes directory with minimal structure:
name: My theme
Inheritance
Themes support one level inheritance you can specify parent theme by extends option in neon file:
name: My theme extends: theme
Loading templates
After activating theme app will search for template files this way:
- search for
%themeDir%/templates/%templateName - in case theme extends another theme it seaches for
%anotherThemeDir%/templates/%templateName% - if no template was found above it searches for file in normal "Nette" way
annotate/themes 适用场景与选型建议
annotate/themes 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 290 次下载、GitHub Stars 达 3, 最近一次更新时间为 2015 年 01 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 annotate/themes 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 annotate/themes 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 290
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 9
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-14