doob-code/laravel-blade-snippets
Composer 安装命令:
composer require doob-code/laravel-blade-snippets
包简介
A very simple Blade directive to allow components and HTML to be rendered directly to a php variable from within a view.
README 文档
README
A simple Blade directive for Laravel that allows you to render components and HTML directly to a PHP variable from within a Blade view. This is particularly useful for passing dynamic content to Livewire components or other parts of your application.
Installation
You can install the package via Composer:
composer require doob-code/laravel-blade-snippets
Service Provider
This package will automatically register its service provider, but if you need to do it manually, add the service provider to your config/app.php file:
'providers' => [ // ... DoobCode\BladeSnippets\BladeSnippetServiceProvider::class, ],
Usage
Defining Snippets
Use the @snip and @endsnip directives to capture Blade components or HTML into a variable.
Example:
@snip('popoverContent') <x-popover>Dynamic section content here</x-popover> @endsnip <!-- Pass the $popoverContent variable to a Livewire component --> @livewire('valuation.next-page-button', [ 'disabled_popover' => $popoverContent, ])
Note on Variables
When using the directives, make sure to provide a variable name without extra quotes. The directive automatically trims surrounding quotes.
License
This package is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or enhancements.
Acknowledgments
- Laravel framework
- Blade templating engine
doob-code/laravel-blade-snippets 适用场景与选型建议
doob-code/laravel-blade-snippets 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 10 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 doob-code/laravel-blade-snippets 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 doob-code/laravel-blade-snippets 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-10-18