2016-06-16 8 views
0

안녕하세요. 사용자가 특정 레코드를 편집하는 곳입니다. 그것은 여기의 비하인드이 enter image description here컨트롤러에서보기의 데이터를 인식하지 못합니다. laravel 4.2

과 같은 형태로 내 관점에서, 나는 이미 입력을 채워이 여기

public function savemodfile($scid , $id) 
{ 
    $rules = array(
     'x' => 'required|min:2|max:250|unique:nsa_fileuploads,filename' 
    ); 

    $messages = array(
     'x.required' => 'Please provide a filename.', 
     'x.min'  => 'Filename should have atleast 2 characters.', 
     'x.max'  => 'Filename can only have maximum of 250 characters.', 
     'x.unique' => 'Filename already exist.' 
    ); 

    $validator = Validator::make(Input::all(), $rules , $messages); 
    if ($validator->fails()) 
    { 
     dd('some errors'); 
    } 
    else 
    { 
     dd('okay'); 
    } 
} 

는 IS 받도록 내 다음 코드

{{ Form::model($list, array('route' =>array('modfyFilesave',$list->subcategoryid , $list->fileid),'method'=>'PUT')) }} 
      <h6>Filename : </h6> 
      {{ Form::text('x', $list->filename , array('class' => 'validate')) }} 
      <h6>File type : {{ $list->filetype }} </h6> 
      @if($list->filetype == 'ppt' || $list->filetype == 'pptx') 
       <img src="{{ asset('img/ico/pptico.PNG') }}" class="imgico"> 

      @elseif($list->filetype == 'doc' || $list->filetype == 'docx') 
       <img src="{{ asset('img/ico/wordico.PNG') }}" class="imgico"> 

      @elseif($list->filetype == 'pdf') 
       <img src="{{ asset('img/ico/pdfico.PNG') }}" class="imgico"> 

      @elseif($list->filetype == 'xls' || $list->filetype == 'xlsx') 
       <img src="{{ asset('img/ico/excelico.PNG') }}" class="imgico"> 

      @elseif($list->filetype == 'txt') 
       <img src="{{ asset('img/ico/txtico.PNG') }}" class="imgico"> 

      @elseif($list->filetype == 'csv') 
       <img src="{{ asset('img/ico/csvico.PNG') }}" class="imgico"> 
      @endif 

      <h6>Size  : {{ $list->filesize }} </h6> 
      @if($list->confidential == 'true') 
       {{ Form::checkbox('conf', 'true', true , array('id' => 'test5')) }} 
       <label for="test5">confidential</label> 
      @else 
       {{ Form::checkbox('conf', 'true', null , array('id' => 'test5')) }} 
       <label for="test5">confidential</label> 
      @endif 

      {{Form::select('sCategory',[ $list->subcategoryid =>'CURRENT CATEGORY : ' . $list->subcategoryname . ' | ' . $list->maincategoryname] + $cats)}} 

      {{ Form::submit('save', array('class' => 'btn btn-primary defcolor')) }} 
     {{ Form::close()}} 

기능입니다 것은 내 시야에서 항상 심지어 if($validator->fails()) 안에 들어간다. 데이터가있다. 내 실수를 지적 할 수있는 사람? 또는 내 코드를 향상시킬 수 있습니까? 미리 감사드립니다.

답변

관련 문제