【问题标题】:laravel blade form show me an exception errorlaravel 刀片表单向我显示异常错误
【发布时间】:2014-09-10 21:31:34
【问题描述】:

首先抱歉我的英语不好。 我有一个使用刀片模板引擎的 laravel 表单,它向我显示异常错误。如果我删除代码并使用带有 echo statmente 的 php 表单,一切都很好,页面就会显示出来。 问题出在哪里?这是我的代码

{{ 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() }}

【问题讨论】:

  • 看完 Alley Shairus 的回答:如果你使用任何一种 IDE(智能开发环境),它都会向你显示此类错误。首先阅读文档总是一个好主意
  • 抱歉,重构代码时将textmethod更改为titlw。

标签: laravel


【解决方案1】:

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() }}

确保您自己找出这些错误,因为这些是输入错误。

【讨论】:

猜你喜欢
  • 2021-05-19
  • 2016-09-12
  • 2015-05-06
  • 2016-08-16
  • 2018-11-11
  • 2016-01-05
  • 2017-04-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多