在需要调用的地方添加
<?php $this->widget('Widget_Contents_Post_Recent','pageSize=10')->to($recent); if($recent->have()): while($recent->next()): ?> <li><a href="<?php $recent->permalink();?>"><?php $recent->title();?></a></li> <?php endwhile; endif;?>