ordercontroller.phpwie man Array durch variable
$link = 'http://api.amid.tech/alldata/0';
$viewdata = (array)json_decode(file_get_contents($link)) ;
$viewordernames=$viewdata['orders'][0];// here we are just showing admin table
$this->orderId=$viewdata['orders'][0];
$this->orderSerial=$viewdata['orders'][0];
$viewdata=array(
$viewdata['id']=> 'id',
$viewdata['orderSerial']=> 'orderSerial',
$viewdata['order_place_by']=> 'order_place_by',
$viewdata['afterDisAmount']=> 'afterDisAmount',
$viewdata['grandTotal']=> 'grandTotal',
$viewdata['actual_price']=> 'actual_price',
$viewdata['customerId']=> 'customerId',
$viewdata['customerId']=> 'customerId',
$viewdata['createdAt']=>'createdAt'
);
I Variable in meiner Ansicht
<div class="container">
<div class="jumbotron">
<h1><?php echo $id?></h1>
<p>This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
<p><a class="btn btn-primary btn-lg">Learn more</a></p>
</div>
</div>
ich in diesem Abschnitt in den Variablen zeigen will zeigen wollen. Ich erstelle Array nicht richtig.
Beginnen Sie mit dem Erlernen der grundlegenden PHP-Syntax. –
Mögliches Duplikat von [Variable vom Controller zur Anzeige in CodeIgniter übergeben] (http://stackoverflow.com/questions/12294527/passing-variable-from-controller-to-view-in-codeigniter) – manniL