Using Webservices I receive a reply in the following format:
Array
(
[Data] => Array
(
[A] => Array
(
[B] => Array
(
[0] => Array
(
[C] => Array
(
[value] => some value1
)
[D] => Array
(
[value] => some value2
)
[E] => some value3
)
[1] => Array
(
[C] => Array
(
[value] => some value4
)
[D] => Array
(
[value] => some value5
)
[E] => 5
)
)
[value] =>
using magento as php framework i create a controller displaying the following information
public function bynumberAction(){
$t = new \RocketShipIt\Track('fedex');
$response = $t->track('770190256519');
// parse results
$events['C'] = $response['A']['B']['C'];
$events['D'] = $response['A']['B']['D']
$events['E'] = $response['A']['B']['E']
// serve results
$this->loadLayout( array('default','shipping_track_bynumber'));
$this->_initLayoutMessages('customer/session');
$this->getLayout()->getBlock('track_bynumber')
->setCollection($events)
->setTemplate('shipping/track/bynumber.phtml');
$this->renderLayout();
}
On the frontend phtml (bynumber.phtml) file I put:
<?php $res = $this->getCollection() ?>
<?php foreach ($res as $row) {echo $row['C'] . ' ' . $row['D'] . ' ' . $row['E'] . '<br />';} ?>
No information is displayed.. any help appreciated. brgds