简体   繁体   English

引导程序在laravel5中不起作用

[英]bootstrap not working in laravel5

I followed this turotial as basic laravel learning. 我遵循此教程作为基本的laravel学习。 I executed composer require illuminate/html . 我执行了composer require illuminate/html To import bootstrap in my project, in 'providers', I added 为了在我的项目中导入引导程序,在“提供者”中,我添加了

 Illuminate\View\ViewServiceProvider::class,
 Illuminate\Html\HtmlServiceProvider::class,

And in alaises, i added 而且,我补充说

'Form'=> Illuminate\Html\FormFacade::class,
 'Html'=> Illuminate\Html\HtmlFacade::class,

But the bootstrap does not seem to be working. 但是引导似乎没有起作用。

{!! Form::open() !!}

    <div class="form-group">
            {!! Form::label("name : ", "Your name") !!}
            {!! Form::text("username", null, ["class"=>"form-control"]) !!}
        </div>

 {!! Form::close() !!}

The text field does not stretch to the width of page, as it is supposed to. 文本字段不会像预期的那样延伸到页面的宽度。

Any idea why is it so? 知道为什么会这样吗? or any other alternative solution ? 或任何其他替代解决方案?

You need to include link to bootstrap in your html template file. 您需要在HTML模板文件中包含引导程序的链接。

<!doctype html>
<html>
    <head>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    </head>
    <body>
        <div id = "container">
            @yield("content")
        </div>
    </body>
</html>

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

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