1
我laravel的一个明显的初学者,我有一个关于这个问题: 的Symfony \分量\ HttpKernel \异常\ NotFoundHttpException的Symfony 分量 HttpKernel 异常 NotFoundHttpException
我不知道是什么,似乎成为问题..每当我点击注册按钮时,该错误将显示出来。这个错误的可能原因是什么?
AdminController.php:
<?php
class AdminController extends Basecontroller{
public function index()
{
return View::make('content.index');
}
public function registration()
{
return View::make('content.registration');
}
public function registrationSave()
{
$input= Input::all();
$rules = array('username'=>'required|unique:admin', 'name'=>'required|unique:admin', 'password'=>'required');
$validate = Validator::make($input,$rules);
if($validate->passes())
{
$password = $input['password'];
$password = Hash::make($password);
$user= new User();
$user->username=$input['username'];
$user->name=$input['name'];
$user->password=$password;
$user->save();
return Redirect::to('registration');
}
}
}
routes.php文件:
Route::get('/','[email protected]');
// Admin Registration
Route::get('admin/registration','[email protected]');
Route::post('admin/registration','[email protected]');
registration.blade.php:
@extends('layouts.master')
@section('content')
{{ Form::open(['url'=>'admin/registrationSave']) }}
<div>
{{ Form::label('name','Name: ') }}
{{ Form::text('name','',['placeholder'=>'Name']) }}
</div>
<div>
{{ Form::label('username','Username: ') }}
{{ Form::text('username','',['placeholder'=>'Username']) }}
</div>
<div>
{{ Form::label('password','Password: ') }}
{{ Form::password('password','',['placeholder'=>'Password']) }}
</div>
<div>
{{ Form::submit('Register') }}
</div>
{{ Form::close() }}
@endsection
感谢您的帮助先生!这个解决方案有效 – staphhelpme 2014-09-30 16:20:18
np,很高兴帮助 – 2014-09-30 16:20:47
先生,还有一件事。另一个错误发生,QLSTATE [42S02]:基表或视图未找到:1146表..我可能做错了什么? – staphhelpme 2014-09-30 16:25:27