codeigniter - Codeignighter - Undefined variable in the view -


i have been scratching head while on one,

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);     } 

produces error undefined variable: org_details in view. can't work out why not work

edit view requested

<?php foreach($org_details $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 ?> 

i have updated controller answeres have come in , still having same result

pass org_details in data array since load->view accept 2 parrameters..

data passed controller view way of array or object in second parameter of view loading function.

public function business() {    $org = $this->session->userdata['logged_in']['org_id'];    $data['org_details'] = $this->business_model->org_account($org);       $data ['navigationcontent']=$this->load->view('parts/p_navigation', array(), true);    $data['maincontent'] = $this->load->view('platform/business', array(), true);    $this->load->view('templates/platform', $data); } 

docs here


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -