通过Composer下载后如何设置Bootstrap? [英] How do I set up Bootstrap after downloading via Composer?

查看:47
本文介绍了通过Composer下载后如何设置Bootstrap?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Composer的初学者,所以我对此一无所知,也没有Web应用程序开发的经验.

I'm a beginner with Composer, so I know little about it and have little experience with web application development.

我正在阅读 Nettuts + 教程,并有一个关于Composer的基本问题.

I was reading the Nettuts+ Tutorial, and have a basic question about Composer.

{
  "require": {
    "laravel/framework": "4.0.*",
    "way/generators": "dev-master",
    "twitter/bootstrap": "dev-master",
    "conarwelsh/mustache-l4": "dev-master"
  },
  "require-dev": {
    "phpunit/phpunit": "3.7.*",
    "mockery/mockery": "0.7.*"
  },
  "autoload": {
    "classmap": [
      "app/commands",
      "app/controllers",
      "app/models",
      "app/database/migrations",
      "app/database/seeds",
      "app/tests/TestCase.php"
    ]
  },
  "scripts": {
    "post-update-cmd": "php artisan optimize"
  },
  "minimum-stability": "dev"
}

如果如上所述那样设置composer.json文件,则在执行composer install --dev之后,如何使Bootstrap可用于Laravel项目?

If I set up my composer.json file as above, after executing composer install --dev, how do I make Bootstrap available for use in the Laravel project?

我的意思是,我可以看到Bootstrap软件包已下载到供应商目录.在我只从官方网站下载Bootstrap并将其手动放入Laravel的公共目录之前,但是这里正确的方法是什么?是否可以将Bootstrap文件保留在原处,因为我想定期将Bootstrap软件包更新到最新版本?

I mean, I can see the Bootstrap package is downloaded to the vendor directory. Before I only used to download Bootstrap from its official website and manually put the files in the public directory of Laravel, but what is the right way to do this here? Can I leave the Bootstrap files where they are, because I want to update the Bootstrap package to its latest version periodically?

谢谢.

推荐答案

我们有工匠命令来发布资产(CSS,JS等).这样的事情应该起作用.

We have artisan command to publish the assets(CSS, JS,..). Something like this should work.

php artisan asset:publish --path="vendor/twitter/bootstrap/bootstrap/css" bootstrap/css
php artisan asset:publish --path="vendor/twitter/bootstrap/bootstrap/js" bootstrap/js

我不确定路径.但这应该可行.

i am not sure about the path.. But this should work.

这篇关于通过Composer下载后如何设置Bootstrap?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆