예제 #1
0
?>
' method='post' enctype='multipart/form-data'>
  <input type='hidden' name='_method' value='put' />
  <table class='table-form'>
    <tbody>

      <tr>
        <th>類 別:</th>
        <td>
            <select name='invoice_tag_id'>
              <option value='0'<?php 
echo (isset($posts['invoice_tag_id']) ? $posts['invoice_tag_id'] : $invoice->invoice_tag_id) == 0 ? ' selected' : '';
?>
>其他</option>
        <?php 
if ($tags = InvoiceTag::all()) {
    foreach ($tags as $tag) {
        ?>
                  <option value='<?php 
        echo $tag->id;
        ?>
'<?php 
        echo (isset($posts['invoice_tag_id']) ? $posts['invoice_tag_id'] : $invoice->invoice_tag_id) == $tag->id ? ' selected' : '';
        ?>
><?php 
        echo $tag->name;
        ?>
</option>
          <?php 
    }
}