maidenvoyagesoftware/laravel-raw-view
最新稳定版本:2.0.0
Composer 安装命令:
composer require maidenvoyagesoftware/laravel-raw-view
包简介
It's intended to compile a view from the HTML string 'on the fly'. You don't need to create a view file.
README 文档
README
RawView for Laravel 5.5+ gives an ability to compile a view from the raw HTML code with Blade directives without creating a view file.
Install
Via Composer
$ composer require maidenvoyagesoftware/laravel-raw-view
After that the view_raw function will be available. It works like the view function but you must specify the HTML code instead of the name of the view.
Usage
class Item { public $tpl = '<li class="{{ $item->makeClasses() }}"> {{ $item->name }}'; ... public function render() { return view_raw($this->tpl, ['item' => $this])->render(); } } // View <ul> @foreach($items as $item) {!! $item->render() !!} @endforeach </ul>
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-29