curtisblackwell/laravel-blade-directive-yaml-injector
Composer 安装命令:
composer require curtisblackwell/laravel-blade-directive-yaml-injector
包简介
A short description of what your package does
README 文档
README
This package enables you to inject YAML data into your views.
Installation
composer require curtisblackwell/laravel-blade-directive-yaml-injector
Usage
@yaml('myVar', 'my-yaml-file')
Example
// config/app.php 'providers' => [ ... CurtisBlackwell\YamlInjectionProvider::class, ... ],
@yaml('bowie', 'david-bowie') <table> <thead> <tr> <th>Year</th> <th>Title</th> </tr> </thead> <tbody> @foreach($bowie['albums'] as $album) <tr> <td>{{ $album['year'] }}</td> <td>{{ $album['title'] }}</td> </tr> @endforeach </tbody> </table>
# resources/views/david-bowie.yaml albums: - title: Self-titled year: 1967 - title: Self-titled year: 1969 - title: The Man Who Sold the World year: 1970 - title: Hunky Dory year: 1971 - title: The Rise and Fall of Ziggy Stardust and the Spiders from Mars year: 1972
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: CC-BY-4.0
- 更新时间: 2017-04-20