是否有任何方法来获取同一页上的数据在编码器


is there any way to fetch data on same page in codeigniter

我在这段代码中卡住了,请帮助我。

<div class="box box-info">
     <div class="box-header with-border">
          <a href='admin_dashboard.php?option=borrow' class='btn btn-danger'>borrow detail</a>||<a href='dashboard.php?option=lender' class='btn btn-danger'>lender detail</a>
      <br/>
      <br/>


<?php
      $option = isset($_REQUEST['option'])==TRUE?$_REQUEST['option']:"";
      // echo $option;
      if($option=='borrow')
      {
         include('borrow_detail.php');
      }else{
           include('lend_detail.php');
     }
  ?>

如何在codeigniter中更改此代码。

根据我的理解,我猜你需要将你发布的php代码转换为codeigniter。以下是你如何做到这一点:

$option = $this->input->get('option')?$this->input->get('option'):"";
  if($option=='borrow')
  {
     $this->load->view('borrow_detail.php');         
  }else{
     $this->load->view('lend_detail.php');
 }