stillat/antlers-layouts
Composer 安装命令:
composer require stillat/antlers-layouts
包简介
README 文档
README
Antlers Layouts is a Statamic addon that allows you to extend arbitrary layouts and pass data to your template's layouts.
Features
This addon:
- Allows you to extend arbitrary layouts from within your Antlers templates;
- Pass data to layouts from templates
How to Install
You can install this addon by running the following command from your project root:
composer require stillat/antlers-layouts
How to Use
The Antlers Layouts addon provides a single layout Tag that allows you to extend arbitrary layouts and pass data to your template's layout.
The recommended way to organize multiple layouts within your Statamic project is to create a new folder at the following locations to contain your extra layout templates:
resources/views/layouts/
Assuming we had a file named resources/views/layouts/custom-layout.antlers.html, we could use dynamically swap to this layout by including the following Antlers tag anywhere in our template:
{{ layout:layouts/custom-layout }}
By including this Tag, Antlers will now utilize the resources/views/layouts/custom-layout.antlers.html file as our layout instead of the normal resources/views/layout.antlers.html file.
We can use the layout:share Tag to pass data to our Antlers layout files:
{{ layout:share variable_one="Value One"
variable_two="Another value"
:variable_three="title" /}}
It is important to note that the
layout:shareTag will only pass custom variables to the standardlayout.antlers.htmltemplate file, and custom layouts located within theresources/views/layouts/folder.
Our custom variables created using the layout:share Tag will now be available to us in our layout file like any other variable:
{{# Inside the layout template. #}} {{ variable_one }} {{ variable_two }} {{ variable_three }}
License
Antlers Layouts is free software released under the MIT License.
stillat/antlers-layouts 适用场景与选型建议
stillat/antlers-layouts 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.5k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 04 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 stillat/antlers-layouts 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 stillat/antlers-layouts 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 6.5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-04-10