Last active
November 2, 2015 11:14
-
-
Save nicolasbinet/e0db04b92056dc7525d0 to your computer and use it in GitHub Desktop.
Laravel validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if ($errors->any()) | |
<p class="alert alert-danger">{{ trans('validation.form_not_valid') }}</p> | |
@endif | |
<div class="panel panel-default"> | |
<div class="panel-heading">Référencement</div> | |
<div class="panel-body"> | |
<div class="form-group @if ($errors->has('seo[title]')) has-error has-feedback @endif"> | |
{!! Form::label('seo[title]', 'Titre', ['class' => 'control-label']) !!} | |
{!! Form::text('seo[title]', null, ['class' => 'form-control']) !!} | |
@if ($errors->has('seo[title]')) | |
<p class="help-block">{{ $errors->first('seo[title]') }}</p> | |
@endif | |
</div> | |
<div class="form-group @if ($errors->has('seo[keywords ]')) has-error has-feedback @endif"> | |
{!! Form::label('seo[keywords]', 'Mots-clés', ['class' => 'control-label']) !!} | |
{!! Form::text('seo[keywords]', null, ['class' => 'form-control']) !!} | |
@if ($errors->has('seo[keywords]')) | |
<p class="help-block">{{ $errors->first('seo[keywords]') }}</p> | |
@endif | |
</div> | |
<div class="form-group @if ($errors->has('seo[description]')) has-error has-feedback @endif"> | |
{!! Form::label('seo[description]', 'Description', ['class' => 'control-label']) !!} | |
{!! Form::textarea('seo[description]', null, ['class' => 'form-control', 'rows' => 3]) !!} | |
@if ($errors->has('seo[description]')) | |
<p class="help-block">{{ $errors->first('seo[description]') }}</p> | |
@endif | |
</div> | |
<div class="form-group @if ($errors->has('seo[noindex]')) has-error has-feedback @endif"> | |
{!! Form::label('seo[noindex]', 'Indexable par les moteurs de recherche', ['class' => 'control-label']) !!} | |
{!! Form::select('seo[noindex]', [1 => 'Autorisée', 0 => 'Pas d\'indexation'], null, ['class' => 'form-control']) !!} | |
@if ($errors->has('seo[noindex]')) | |
<p class="help-block">{{ $errors->first('seo[noindex]') }}</p> | |
@endif | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment