php - 如何从 html 调用 Laravel 函数?
问题描述
我想要这个html代码
<div class="form-group">
<label for="company_policy_file_path">Policy File Path<span class="required"> : (Required Field)</span></label>
<input id="company_policy_file_path" type="text" name="file_path" class="form-control" placeholder="Please Enter the file path" />
</div>
将文件上传到后端并执行此 laravel 功能
<?php
echo Form::open(array('url' => '/uploadfile','files'=>'true'));
echo 'Select the file to upload.';
echo Form::file('image');
?>
谁能给我关于如何实现这一目标的建议?
解决方案
{{Form::open(['url' => '/uploadfile', 'files' => true])}}
<div class="form-group">
{{Form::label('company_policy_file_path', 'Policy File Path<span class="required"> : (Required Field)</span>')}}
{{Form::text('file_path', '', ['id' => 'company_policy_file_path', 'class' => 'form-control', 'placeholder' => 'Please Enter the file path'])}}
</div>
<div class="form-group">
{{Form::label('image', 'Select the file to upload.')}}
{{Form::file('image', array('id' => 'image'))}}
</div>
<div class="form-group">
{{Form::submit('Save', ['class' => 'btn btn-success'])}}
</div>
{{Form::close()}}
推荐阅读
- javascript - JS:删除星号之间的前导和尾随空格(有效降价)
- group-by - clickhouse 下采样到 OHLC 时间条间隔
- python - 代码未在输出 excel 文件中创建新的 excel 表
- python - python文件带参数时如何使用cProfile mod?
- sql - How do I display records in the same row although I am using group by on 2 columns that appear in different rows right now?
- aws-lambda - serverless: When 302 redirect the custom header or set-cookie header not getting passed
- servicestack - ServiceStack:当在服务之外抛出异常时,AppHost.OnRequestEndCallbacks 处理程序被调用两次
- swift - 视口?还是相机?视野?旋转 iOS 设备上的变化
- generics - 是否可以自动推断出一种传递的泛型?
- python - Seaborn (violinplot) y 轴值过多