简体   繁体   English

可以在php中使用node.js库

[英]It is possible to use node.js library in php

I'm doing a project in laravel and i need to use this library ( https://www.npmjs.com/package/lunar-calendar ) but this is for node.js. 我正在laravel中做一个项目,我需要使用这个库( https://www.npmjs.com/package/lunar-calendar ),但这是用于node.js的。

There is any chance to use this in my laravel project? 有没有在我的laravel项目中使用此功能的机会? I also find this library https://www.npmjs.com/package/php-require . 我还找到了这个库https://www.npmjs.com/package/php-require

What i have to do? 我该怎么办?

Thank you 谢谢

No you cannot use JS library in PHP, And npm is a tool used to download libraries. 不,您不能在PHP中使用JS库,而npm是用于下载库的工具。

What you can do : 你可以做什么 :

Get your library . 获取您的图书馆

Copy it to your public folder and call it from the views based on your conditions. 将其复制到您的公用文件夹,然后根据您的条件从视图中调用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM