rtler/blademacro 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rtler/blademacro

Composer 安装命令:

composer require rtler/blademacro

包简介

add macro to blade laravel

README 文档

README

macro extension for laravel blade. it add macros to laravel blade that work just like html macro but there is problem with html macro that it register and echo function into compiled view code and run functin every time page loads, but this library run fubction and echo return into compiled view.

##installation add this to your providers

    'providers' => [
		...
        RTLer\BladeMacro\BladeMacroServiceProvider::class
		...
    ],

##usage and register macroes using(for adding php code to view write it in string)

      BladeMacro::macro('inputText', function ($arg1, $arg2, $arg3, $arg4) {
          return 'testing ' . $arg1 . ' ' . $arg2 . ' ' . $arg3 . ' ' . $arg4;
      });

*it can contains php code in return string

and in view use it like this (macroName(arg1, arg2, ...)):

    @macroInputText('name', 'value', 'label', 'options')

and becuse of that this code replase the return string of the BladeMacro::macro function and cache it, after changeing the macro run the command

php artisan view:clear

##contribute i add Illuminate\Html to it (htmlName(arg1, arg2, ...),formName(arg1, arg2, ...)) but there is problem with form if you like to help fix form.

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL2
  • 更新时间: 2015-08-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固