【问题标题】:Is bootstrap included in Laravel 4?Laravel 4 中是否包含引导程序?
【发布时间】:2015-03-03 20:20:02
【问题描述】:

我的 laravel 应用中有“bootstrap”子文件夹,这是否意味着 Laravel 中包含 bootstrap?

【问题讨论】:

    标签: twitter-bootstrap laravel laravel-4


    【解决方案1】:

    没有。 bootstrap 不仅仅指 Twitter Bootstrap。来自Wikipedia

    一般来说,自举通常是指启动 应该在没有外部环境的情况下进行的自我维持过程 输入。在计算机技术中,该术语(通常缩写为引导) 通常是指将基础软件加载到 上电或一般复位后计算机的内存,尤其是 操作系统将负责加载其他软件 根据需要。

    注意,同样在 Stack Overflow 上,[bootstrap] 标记会执行 NOT refer to Twitter Bootstrap。这就是 [twitter-bootstrap] 标签的用途。

    那么它到底是什么?

    bootstrap 目录中的几个文件将引导、启动、初始化应用程序。

    • autoload.php 如果可能,从 vendor/autoloadcompiled.php 自动加载类
    • (compiled.php) 预编译的框架类
    • paths.php 定义相对于bootstrap 目录的重要路径
    • start.php “启动”应用程序。环境检测、加载路径和创建容器实例Application

    【讨论】:

      【解决方案2】:

      不,不是。你在 laravel 应用中看到的 bootstrap 文件夹包括

      • autoload.php
      • paths.php
      • start.php

      阅读有关 laravel 的更多信息Request Lifecycle on laravel doc,了解 Laravel 的工作原理。

      【讨论】:

        【解决方案3】:

        你可以在你的项目文件夹中使用 twitter bootstrap,但是如果你想使用 bootstrap 的所有样式和库,你需要在你的 master.blade 中包含 .js。 css引导文件

        例子:

        {{ HTML::script('http://public/assets/js/bootstrap.3.0.0.min.css') }} // This include all the css files of bootstrap.
        
        {{ HTML::script('http://public/assets/js/bootstrap.3.0.0.min.js') }} // This include rapall the functionalities of bootstrap
        

        当然你需要添加你自己的引导文件和路径。

        包含 .js 和 .css 后,您可以使用引导程序的所有人员,例如:

        <button type="button" class="btn btn-info">Save</button>
        

        btn btn-info类是一种引导风格。

        【讨论】:

          猜你喜欢
          • 2014-04-15
          • 2013-01-04
          • 1970-01-01
          • 1970-01-01
          • 2021-04-23
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2016-12-24
          相关资源
          最近更新 更多