我有一个名为 $pages 的数组,内容如下:
Array
(
[01-about-us] => Page Object
(
[_uri] => about-us
[_menuItem] => 01
[_visable] => 1
)
[02-contact] => Page Object
(
[_uri] => contact
[_menuItem] => 02
[_visable] => 1
)
[_sitemap] => Page Object
(
[_uri] => sitemap
[_menuItem] =>
[_visable] =>
)
[home] => Page Object
(
[_uri] => home
[_menuItem] =>
[_visable] => 1
)
)
有没有一种简单的方法可以通过那里的属性循环并获取页面对象,即:
<?php foreach($pages->_visible() AS $p): ?>
<li> page </li>
<?php endforeach ?>