Php 为什么不叫商店?
虽然我已经为我的控制器定义了scrud方法的路径,如下所示:Php 为什么不叫商店?,php,laravel-4,Php,Laravel 4,虽然我已经为我的控制器定义了scrud方法的路径,如下所示: Route::resource('widgets', 'WidgetsController'); 当我创建一个新的小部件时,不会调用存储方法,而是调用索引方法 创建新小部件的形式很简单: {{ Form::open(array('class'=>"form-horizontal" , 'url' => 'widgets','files'=>true)) }} <fieldset>
Route::resource('widgets', 'WidgetsController');
当我创建一个新的小部件时,不会调用存储
方法,而是调用索引
方法
创建新小部件的形式很简单:
{{ Form::open(array('class'=>"form-horizontal" , 'url' => 'widgets','files'=>true)) }}
<fieldset>
<!-- Form Name -->
<legend>Add new widget </legend>
<div class="form-group">
{{Form::label('title', 'Title',array('class' => "col-md-4 control-label"))}}
<div class="col-md-4">
{{Form::text('title', '')}}
</div>
</div>
<div class="form-group">
{{ Form::label('file','Choose widget zip file',array('class' => "col-md-4 control-label", 'id'=>'')) }}
<div class="col-md-4">
{{ Form::file('file','',array('id'=>'','class'=>'input-file')) }}
</div>
</div>
<!-- Button -->
<div class="form-group">
<label class="col-md-4 control-label" for="singlebutton">Create widget</label>
<div class="col-md-4">
<button id="singlebutton" name="singlebutton" class="btn btn-primary">Upload</button>
</div>
</div>
</fieldset>
{{ Form::close() }}
{{Form::open(数组('class'=>“Form horizontal”、'url'=>“widgets”、'files'=>true))}
添加新小部件
{{Form::label('title','title',array('class'=>“col-md-4控制标签”)}
{{Form::text('title','')}
{{Form::label('file','Choose widget zip file',array('class'=>“col-md-4控制标签”,“id'=>”)}
{{Form::file('file','',数组('id'=>'','class'=>'input-file'))}
创建小部件
上传
{{Form::close()}}
有什么想法吗?您没有定义任何
submit
按钮
将type=“submit”
添加到您的上传按钮,或使用LaravelForm::submit(“上传”)
helper
<!-- Button -->
<div class="form-group">
<label class="col-md-4 control-label" for="singlebutton">Create widget</label>
<div class="col-md-4">
{{ Form::submit('Upload', array('class' => 'btn btn-primary')) }}
</div>
</div>
创建小部件
{{Form::submit('Upload',array('class'=>'btn btn primary'))}