0
我無法讓表單提交工作。按提交後,它表明找不到控制器。即使我已經在我的控制器類中定義了。我想要的是在控制器中的getLoginauth函數中獲取發佈數據。提交laravel的發佈數據
查看頁面
<div class="panel-body">
<?php echo Form::open(array('action' => '[email protected]')); ?>
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="E-mail" name="email" type="email" autofocus>
</div>
<div class="form-group">
<input class="form-control" placeholder="Password" name="password" type="password" value="">
</div>
<div class="checkbox">
<label>
<input name="remember" type="checkbox" value="Remember Me">Remember Me
</label>
</div>
<!-- Change this to a button or input when using this as a form -->
<input type = "submit" class="btn btn-lg btn-success btn-block" value = "Login"/>
</fieldset>
<?php echo Form::close();?>
</div>
控制器頁面
class PortalController extends BaseController
{
public function getIndex()
{
if (Auth::check())
{
return View::make('admin_index');
}else{
return Redirect::to('admin/login');
}
}
public function getLogin(){
return View::make('admin_login');
}
public function getLoginauth(){
echo 'here';
}
}
路線頁面
Route::get('/', function()
{
return View::make('hello');
});
Route::controller('account' , 'AccountController');
Route::controller('admin' , 'PortalController');
Route::post('admin/loginauth', '[email protected]');
嗨感謝您的評論。但即時通訊仍然得到「控制器方法找不到」後,我的表單動作更改爲網址。有其他的東西,我需要設置其他的PHP文件? –