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
其他信息
- 授权协议: MIT
- 更新时间: 2020-11-16