【问题标题】:Dropzone js uploads images in the other form to fill. Laravel 4Dropzone js 上传另一种形式的图片进行填充。拉拉维尔 4
【发布时间】:2015-03-03 13:50:23
【问题描述】:

我有一个问题。

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

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网站是这样你必须添加一个Form :: open 'class' => 'dropzone', 'id' => 'my-awesome-dropzone'

有办法吗?

【问题讨论】:

    标签: php image forms laravel upload


    【解决方案1】:

    您可以添加您的class、id 或其他类似以下内容

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

    在 Laravel doc 上阅读有关 Laravel 的表单和 HTML 的更多信息。

    【讨论】:

    • 是的,好的,但是当我将类和 id 添加到表单时,外观会发生变化。 link
    猜你喜欢
    • 1970-01-01
    • 2018-02-25
    • 2015-04-29
    • 2017-11-02
    • 1970-01-01
    • 2021-07-05
    • 1970-01-01
    • 2023-03-28
    • 2014-08-31
    相关资源
    最近更新 更多