[英]Laravel Set Error Delimiters?
Laravel 4是否具有CodeIgniter的等效项
$this->form_validation->set_error_delimiters()
Nope, Laravel comes with a validator and the markup is exactly where it should be: in the view. 不,Laravel带有验证器,标记正好在该位置:在视图中。
http://laravel.com/docs/validation#error-messages-and-views http://laravel.com/docs/validation#error-messages-and-views
Update: 更新:
Although I advise against it the MessageBag actually has a format property, which could be used to store the delimiters. 尽管我建议不要这样做,但MessageBag实际上具有format属性,该属性可用于存储定界符。
$validator = Validator::make( //...
if($validator->fails())
{
$validator->getMessageBag()->setFormat('<p class="error">:message</p>');
}
The MessageBag can only be accessed, after the data has been validated. 验证数据后,才能访问MessageBag。 Make sure to run passes() or fails() before you do so.
确保先运行passs()或failure()。
您可以创建一个验证器: http : //laravel.com/docs/validation
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.