承接 yazvonov/laravel-tojs 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

yazvonov/laravel-tojs

Composer 安装命令:

composer require yazvonov/laravel-tojs

包简介

Transform PHP Vars to JavaScript for Laravel

README 文档

README

How to install

composer require yazvonov/laravel-tojs

What It Does

This package Transform PHP Vars to JavaScript.

Put variables

ToJs::put([
    'variable1' => 'I want to see you in JavaScript',
    'variable2' => 'I want to see you in JavaScript too',
]);

Add tag @tojs to you blade template before <script>

@tojs

You will see this code on you page, and you can you it in JavaScript like window.laravel.variable1, window.laravel.variable2

<script>window.laravel = {"variable1":"I want to see you in JavaScript","variable2":"I want to see you in JavaScript too"};</script>

Configuration

You can change name in javascript, just add

TOJS_VAR_NAME=another_name 

to your .env file.

Security

If you discover any security-related issues, please email zvonovyo@gmail.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 10
  • Watchers: 6
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固