将引导程序与作曲家一起使用 [英] Use bootstrap with composer
问题描述
我是网络新手程序员,
我正在尝试在家学习制作自己的网络.我有 php、html、js 和 css 的概念.
但我发现了一些无法解决的问题.我正在尝试使用 Composer 来管理 Bootstrap.我安装了 Composer 并运行了这行代码
I'm a web newbie programmer,
I'm trying to learn from home to make my own web.
I have notions of php, html, js and css.
But I've found something that is not how to solve.
I'm trying to use Composer to manage Bootstrap. I installed Composer and I have run this line of code
composer require twbs/bootstrap
删除了一个包含文件的文件夹.
that has dropped a folder with files.
我不明白我是怎么制作html链接来查找js和css文件的,你应该写出完整路径吗?
I do not understand is how I make html links to find the js and css files, you should do indicating the full path?
vendor / twbs / bootstrap / dist / js / bootstrap.js
对不起,如果问题很愚蠢,但我不知道该怎么继续.
原谅我的英语,我也在学习,但现在我使用谷歌翻译
Excuse me if the question is stupid but I do not know how I should continue.
Amd excuse my English, I'm learning too but by now I use google translate
推荐答案
您可以在 composer.json 文件中使用 post update 命令:
You could use a post update command in the composer.json file:
"scripts": {
"post-update-cmd": [
"rm -rf public/bootstrap",
"cp -R vendor/twbs/bootstrap/dist public/bootstrap"
]
}
然后像这样包含 javascript 和 css 文件:
And then just include the javascript- and css-files like this:
<script type="text/javascript" src="{{ ROOT_URL }}bootstrap/js/bootstrap.min.js"></script>
<link href="{{ ROOT_URL }}bootstrap/css/bootstrap.min.css" rel="stylesheet">
这篇关于将引导程序与作曲家一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!