tiny-pixel / acorn-block-templates
Sage 10 的区块模板
1.1.0
2020-08-17 10:15 UTC
Requires
- php: >=7.2
This package is auto-updated.
Last update: 2024-09-15 16:28:38 UTC
README
在 Sage 10 中,使用 Blade 模板轻松覆盖区块标记。
要求
安装
通过 Composer 安装
$ composer require tiny-pixel/acorn-block-templates
用法
在 resources/views
中创建一个 blocks
目录。模板应使用目标区块的名称命名,并放置在与区块命名空间名称匹配的目录中。
示例
├── blocks └── core ├── gallery.blade.php # core/gallery ├── image.blade.php # core/image └── paragraph.blade.php # core/paragraph
模板传递两个变量: $attr
和 $content
。
$attr
是区块属性的数组。$content
是区块输出的字符串。
通过这种方式,您可以覆盖任何区块的模板,无论它是通过 core
或插件注册的。您可以使用 Composers、extends
或 Sage、Illuminate 或其他包提供的任何其他功能。
贡献
鼓励和感谢通过 PR、报告问题或提出建议来贡献。
所有贡献者都必须严格遵守我们的 行为准则。
许可
该项目根据 MIT 许可证提供。