Dropzone js 以其他形式上传图像进行填写.拉拉维尔 4.


Dropzone js uploads images in the other form to fill. Laravel 4

我有一个问题。

如何以添加广告的形式加载图像。目前我有这个:

http://screencast.com/t/2GZsvVjo8

我想加载文件看起来不错,我可以删除添加的图像。

我的观点:

{{ Form::open(array('url'=>'profile/offers/create', 'method' => 'POST', 'files'=>true)) }}
    <p>
        {{ Form::label('id_category', 'Wybierz kategorię oferty') }}
        {{ Form::select('id_category', $categories) }}
    </p>
    <p>
      {{ Form::label('Wpisz tytuł:') }}
      {{ Form:: text('title', null, array('class' => 'form-control', 'required' => '')) }}
    </p>
    <p>
        {{ Form::label('Opis') }}
        {{ Form:: text('description', null, array('class' => 'form-control', 'required' => '')) }}
    </p>
    <p>
        {{ Form::label('Cena') }}
        {{ Form::text('price', null, array('class'=>'form-price')) }}
    </p>
    {{ Form::file('images[]', array('multiple'=>'true', 'class'=>'dropzone', 'id'=>'my-dropzone')) }}
    {{ Form::submit('Create offers', array('class'=>'secondary-cart-btn')) }}
    {{ Form::close() }}

它必须是这一行,因为它负责表单的其余部分

{{ Form::open(array('url'=>'profile/offers/create', 'method' => 'POST', 'files'=>true)) }}

在 dropzone 网站是这样你必须添加一个表单 :: 打开'class' => 'dropzone', 'id' => 'my-awesome-dropzone'

有没有办法做到这一点?

您可以添加classid或其他类似以下内容

{{ Form::open(array('url'=>'profile/offers/create', 'method' => 'POST', 'files'=>true, 'class' => 'dropzone', 'id' => 'my-awesome-dropzone')); }}

在Laravel文档上阅读更多关于Laravel's Forms & HTML的信息。