我有一个这样的数组,我想在视图文件中打印出来,但是它是空的,数组就是这样
array(
(int) 0 => array(
'ProductsUserNode' => array(
'product_user_node_id' => '155',
'user_node_id' => '53',
'product_id' => '1',
'is_active' => '1',
'expiry' => '0000-00-00',
'created' => '2013-01-10 10:27:22',
'modified' => '2013-01-10 10:27:22',
'created_view' => '10:27 AM, Jan 10,2013',
'modified_view' => '10:27 AM, Jan 10,2013'
),
'UserNode' => array(
'user_node_id' => '53',
'division_id' => '28',
'role_id' => '4',
'user_id' => '56',
'created' => '2013-01-10 10:27:20',
'created_view' => '10:27 AM, Jan 10,2013'
),
'Product' => array(
'product_id' => '1',
'name' => 'Manager',
)
),
我在视图文件中使用此代码
foreach ($products as $products)
{
?>
<tr>
<td> <?php $products['ProductsUserNode']['product_id']?> </td>
<td> <?php $products['Product']['name']?> </td>
</tr>
<?php }?>
我也像这样在控制器中设置了变量,
$this->set('products',$products);
但它不工作,有什么问题?提前致谢