所以我想在我的视图脚本中使用一个 jQuery 选项卡容器。我已经对其进行了测试,所以我知道我已经完成了一切工作。
<?php $this->tabContainer()->addPane('container-name', 'label', 'content goes here'); ?>
<?php echo $this->tabContainer('container-name'); ?>
但这是我要放入窗格的内容:
<?php if (count($this->resources->links) > 0): ?>
<h3>Links</h3>
<ul>
<?php foreach ($this->resources->links as $link): ?>
<li><?php echo $link->title; ?></li>
<?php endforeach ?>
</ul>
<?php endif; ?>
如何将 if/foreach 块放入 addPane 函数的内容参数中?