doudui2229
2015-02-03 02:25
浏览 51
已采纳

Codeigniter:将数据从视图传递到控制器

This is my view code:

<p align="center"; style="font-size:22px">Database books</p>
        <table>
      <tr>
        <th>Book ID</th>
        <th>Book Name</th>
        <th>Description</th>
        <th>Author</th>
        <th>Publisher</th>
        <th>Pages</th>
        <th>Publication Date</th>
        <th>Price</th>
        <th>Status</th>
        <th>Quantity</th>
        <th>Genres</th>
        <th>User Rating</th>
        <th>Reviews</th>
        <th>Edit</th>
      </tr>
      <?php foreach($books as $book) { ?>
      <tr>
        <td><?php echo $book->book_id ?></td>
        <td><?php echo $book->book_name ?></td>
        <td><?php echo $book->description ?></td>
        <td><?php echo $book->author ?></td>
        <td><?php echo $book->publisher ?></td>
        <td><?php echo $book->pages ?></td>
        <td><?php echo $book->publication_date ?></td>
        <td><?php echo $book->price ?></td>
        <td><?php echo $book->status ?></td>
        <td><?php echo $book->quantity ?></td>
        <td><?php echo $book->genres ?></td>
        <td><?php echo $book->user_rating ?></td>
        <td><?php echo $book->reviews ?></td>
        <td><a href="<?php echo base_url(); ?>admin/edit_data">Edit</a></td>
      </tr>
      <?php } ?>
    </table>

May i know how do i pass data from my view to my controller, as i would like to pass the information to my edit page. I am trying to search on passing variable using anchor tag, however i am getting information on using GET and POST only are there any other ways?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题