【问题标题】:Laravel 5.2 - installing packages issuesLaravel 5.2 - 安装包问题
【发布时间】:2016-12-08 22:57:06
【问题描述】:

我已经通过 composer 使用这个 cmd 命令在 Laravel 项目中安装了bootstrap plugin

composer require twbs/bootstrap:4.0.0-alpha.3

问题是:

1) 我是 laravel 的新手,为此问题搜索了很多,我发现的每一个都是关于使用 nmp 命令的,我使用的是 Windows 而不是 Mac强>

2) 我在公用文件夹中没有任何引导文件。未找到此结构:

├── css/
│   ├── bootstrap.css
│   ├── bootstrap.css.map
│   ├── bootstrap.min.css
│   ├── bootstrap.min.css.map
│   ├── bootstrap-theme.css
│   ├── bootstrap-theme.css.map
│   ├── bootstrap-theme.min.css
│   └── bootstrap-theme.min.css.map
├── js/
│   ├── bootstrap.js
│   └── bootstrap.min.js
└── fonts/
    ├── glyphicons-halflings-regular.eot
    ├── glyphicons-halflings-regular.svg
    ├── glyphicons-halflings-regular.ttf
    ├── glyphicons-halflings-regular.woff
    └── glyphicons-halflings-regular.woff2

如何将引导程序从供应商加载到我的刀片?

什么手动下载引导文件和使用 composer 安装有什么区别?以及如何以任何方式将引导文件集成到我的刀片中?

同样的问题与安装 blogifyAdminLTE.. 无法使用通过 composer 下载的任何包

使用:

Windows 10 XAMP

【问题讨论】:

  • 要包含 css 文件(在您的情况下为引导程序),只需在刀片模板中包含 CSS 文件...当然,您需要将文件放在“公共”文件夹中。跨度>

标签: twitter-bootstrap laravel composer-php laravel-5.2


【解决方案1】:

如何将引导程序从供应商加载到我的刀片?

正如manual 所提到的,您有更多选项来安装引导程序。

Download the latest release.
Clone the repo: git clone https://github.com/twbs/bootstrap.git.
Install with Bower: bower install bootstrap.
Install with npm: npm install bootstrap@3.
Install with Meteor: meteor add twbs:bootstrap.
Install with Composer: composer require twbs/bootstrap.

如果您已安装任何选项,也请尝试其他选项。

目标是将文件放入 /public 文件夹,您可以从该文件夹中通过浏览器访问这些文件,并且 HTML 可以正常工作。

手动下载引导文件有什么区别 并用作曲家安装它?以及如何集成引导程序 我的刀片中的文件以任何方式?

没什么。 Composer、npm、bower 和其他人会将文件从存储库下载到您运行命令的文件夹中。

所以在 public 文件夹中运行这些命令。

您没有提及是否有任何错误或可能涉及未完成操作的内容。

如果命令不起作用,您仍然可以手动下载,如前所述,应将其保存到公用文件夹中。

您的 index.blade.php 应在标签中包含以下内容:

<link href="<?php echo url("css/bootstrap.min.css"); ?>" stylesheet'      type='text/css'>

或使用elixir

<link href="{{ elixir('css/app.css') }}" rel="stylesheet">

【讨论】:

  • 所以事情就是这样,作曲家仅供下载,但我必须从供应商处剪切文件并将其放在我的公共文件夹中。我说得对吗?
  • 我已经更新了我的答案。 - Composer 是 PHP 中的依赖管理工具。它允许你声明你的项目所依赖的库,它会为你管理(安装/更新)它们。
  • 在您知道自己在做什么之前,不应编辑供应商文件夹。如前所述,将文件作为引导程序放入 laravel 公用文件夹。
  • 来自 laravel 文档:public 目录包含前端控制器和您的资产(图像、JavaScript、CSS 等)。这就是引导程序。
  • 没有。 blogify 是一个 laravel 包,bootstrap 是一个独立的框架。 Bootstrap 适用于 HTML,因此只需将其放在正确的文件夹中。对于 blogify,请查看文档 @blogify.io/docs AdminLTE 的工作方式与 Bootstrap 相同。所以它确实进入了公共文件夹。
猜你喜欢
  • 2017-01-06
  • 2020-06-07
  • 2021-03-11
  • 2018-04-01
  • 2016-05-08
  • 2018-01-08
  • 2022-11-23
  • 2018-11-26
  • 2020-01-08
相关资源
最近更新 更多