2014-09-10 47 views
0

首先對我的壞英語感到抱歉。 我有一個使用刀片模板引擎的laravel表單,它向我展示了一個異常錯誤。如果我刪除代碼,並使用PHP的形式與回聲statmente一切正常,並顯示頁面。 問題在哪裏?這裏是我的代碼laravel blade form向我展示一個異常錯誤

{{ HTML::ul($errors->all()) }} 

{{ Form::open(array('url' => 'news')) }} 

<div class="form-group"> 
    {{ Form::label('name', 'Name') }} 
    {{ Form::title('name', Input::old('title'), array('class' => 'form-control')) }} 
</div> 

<div class="form-group"> 
    {{ Form::label('email', 'Email') }} 
    {{ Form::text('email', Input::old('description'), array('class' => 'form-control')) }} 
</div> 

{{ Form::submit('Create the Nerd!', array('class' => 'btn btn-primary')) }} 

{{ Form::close() }} 
+0

閱讀Alley Shairus之後回答:如果您使用任何一種IDE(智能開發環境),它都會顯示這樣的錯誤。首先閱讀文檔,總是一個好主意 – 2014-09-10 13:37:36

+0

抱歉,重構代碼時文本方法會發生變化。 – 2014-09-10 13:46:50

回答

0

laravel中沒有Form :: title()這樣的事情。

試試這個

{{ HTML::ul($errors->all()) }} 

{{ Form::open(array('url' => 'news')) }} 

<div class="form-group"> 
    {{ Form::label('name', 'Name') }} 
    {{ Form::text('name', Input::old('title'), array('class' => 'form-control')) }} 
</div> 

<div class="form-group"> 
    {{ Form::label('email', 'Email') }} 
    {{ Form::text('email', Input::old('description'), array('class' => 'form-control')) }} 
</div> 

{{ Form::submit('Create the Nerd!', array('class' => 'btn btn-primary')) }} 

{{ Form::close() }} 

確保您,因爲這些都是打字錯誤計算自己這些錯誤。

+0

Soory來自教程http://scotch.io/tutorials/simple-laravel-crud-with-resource-controllers – 2014-09-10 13:38:29