2016-05-10 3 views
1

どのように私は、ブレード・テンプレートに動的なテキストボックス名を追加することができ、私はこれを試してみましたが、それはうまくいきませんでした -ブレードテンプレートにダイナミックテキストボックス名を設定する方法は?

{!! Form::text('update_arr[$i]["id"]', $key['zip'] ,array('class' => 'form-control','id' =>'zip','placeholder' => 'zip')) !!} 

私は、テキストボックス名に$iをループにしたいですか?シンプルなhtmlのように -

<input type="text" name="update_arr[<?php echo $i;?>]['id']" /> 

本当にありがとうございます。ありがとう!

+0

参照:http://stackoverflow.com/questions/23712910/how-to-add-a-dynamic-image-src-with-laravels-blade –

答えて

0

あなたはあなたの引用符についての世話をする必要があり、

{!! Form::text("update_arr[$i]['id']", $key['zip'] ,array('class' => 'form-control','id' =>'zip','placeholder' => 'zip')) !!} 
       ^^    ^^^^//just replaced the single quotes with double one and vice versa 
+0

これも機能しました!ありがとう@Ali –

0

大丈夫、私はこの参照によってそれを解決 - how to add a dynamic image src with laravels blade は、それが他の人に多くの

{!! Form::text('update_arr['.$i.']["id"]', $key['zip'] ,array('class' => 'form-control','id' =>'zip','placeholder' => 'zip')) !!} 

感謝を助けるかもしれません!

関連する問題