我一直在为这个挠头一段时间,
public function business()
{
$org = $this->session->userdata['logged_in']['org_id'];
$query['org_details'] = $this->business_model->org_account($org);
$data = array('navigationContent' => $this->load->view('parts/p_navigation', array(), TRUE), 'mainContent' => $this->load->view('platform/business', array(), TRUE),);
$this->load->view('templates/platform', $data, $query);
}
Undefined variable: org_details
在视图中产生此错误。我不知道为什么这不起作用
按要求编辑视图
<?php foreach($org_details as $row): ?>
<fieldset>
<div class="control-group">
<label class="control-label">Platform Company ID:</label>
<div class="controls">
<input type="text" value="<?= $row['org_id']?>" disabled>
</div>
</div>
<div class="control-group">
<label class="control-label">ABN:</label>
<div class="controls">
<input type="text" value="<?= $row['org_abn']?>" disabled>
</div>
</div>
<div class="control-group">
<label class="control-label">Business Name:</label>
<div class="controls">
<input type="text" value="<?= $row['org_name']?>" disabled>
</div>
</div>
<div class="control-group">
<label class="control-label">Address:</label>
<div class="controls">
<input type="text" value="<?= $row['org_address']?>" disabled>
</div>
</div>
<div class="control-group">
<label class="control-label">Suburb:</label>
<div class="controls">
<input type="text" value="<?= $row['org_suburb']?>" disabled>
</div>
</div>
<div class="control-group">
<label class="control-label">State:</label>
<div class="controls">
<input type="text" value="<?= $row['org_state']?>" disabled>
</div>
</div>
<div class="control-group">
<label class="control-label">Post Code:</label>
<div class="controls">
<input type="text" value="<?= $row['org_pcode']?>" disabled>
</div>
</div>
</fieldset>
<?php endforeach ?>
随着答案的出现,我已经更新了控制器,但结果仍然相同