除了表单元素之外的Div元素,Laravel 5.2 Form Helper

时间:2015-12-28 00:33:53

标签: html twitter-bootstrap laravel-5 laravel-5.2 laravel-blade

我不知道我是否错过了一个div,或者我做错了什么。我没有绝对甚至相对定位可能导致此

所以Modal看起来像:

<div class="modal fade" id="{{ 'editPost' . removeSpaces($post->title) }}" tabindex="-1" role="dialog" aria-labelledby="{{ 'editPost' . removeSpaces($post->title) }}">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="editPost">Edit {{ $post->title }}</h4>
            </div>
            <div class="modal-body">
                @include('blog.posts.edit', ['postToEdit' => $post])
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

好的,所以我们有一个include到目前为止一切都很好......

{{ Form::open(array('url' => array('edit-post', $postToEdit->title), 'class' => 'form-horizontal')) }}
    <div class="form-group">
        {{ Form::label('title', 'Post Title', array('class' => 'col-sm-2 control-label')) }}
        <div class="col-sm-10">
            {{ Form::text('title', $postToEdit->title, array('placeholder' => 'sample title', 'class' => 'form-control')) }}
        </div>
    </div>
    <div class="form-group">
        {{ Form::label('content', 'Post Content', array('class' => 'col-sm-2 control-label')) }}
        <div class="col-sm-10">
            {{ Form::textarea('content', convertToMarkdown($postToEdit->content), array('placeholder' => 'some content', 'class' => 'form-control')) }}
        </div>
    </div>
    <div class="form-group">
        {{ Form::label('tags', 'Post Tags', array('class' => 'col-sm-2 control-label')) }}
        <div class="col-sm-10">
            {{ Form::text('tags', '', array('class' => 'form-control', 'data-role' => 'tagsinput')) }}
        </div>
    </div>
    <div class="form-group">
        {{ Form::label('categories', 'Post Categories', array('class' => 'col-sm-2 control-label')) }}
        <div class="col-sm-10">
            {{ Form::text('categories', '', array('class' => 'form-control', 'data-role' => 'tagsinput')) }}
        </div>
    </div>

    {{ Form::hidden('blogId', $blog->id) }}

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            {{ Form::submit('Create', array('class' => 'btn btn-primary')) }}
        </div>
    </div>
{{ Form::close() }}

这就是问题所在。所有这些form-group div都在form标记之外。除了导致以下内容的默认引导程序css之外,没有css:

[Image[1]

导致此内容的原因

我已经尝试查看表单的计算属性,其元素没什么突出的。再次没有绝对定位。这都是标准的自助爵士乐。

即使我删除了表单元素中的所有标记并将hello world放入其中,它仍然显示在表单的旁边...甚至<form> hello world</form>在表单标记旁边显示hello world

0 个答案:

没有答案