lz19881123 2011-12-21 15:56:33 3014次浏览 5条回复 0 0 0
<?php
Yii::import('zii.widgets.CPortlet');
class New_type extends CPortlet
{
    public $title='新闻标题';
    public $maxNewtype=5;
    public function getNews()
    {
        $att=News::model()->findnewtype($this->maxNewtype);
        return $att;
    }

    protected function renderContent()
    {
        $this->render('new_type');
    }
}

<ul> 
    <?php foreach($this->getNews() as $row):?> <li>
    <?php echo CHtml::link($row["news_title"],array(
        'admin/show','id'=>$row[news_id]
    ))."&nbsp&nbsp" ?></li>
    <?php endforeach;?>
</ul>

标题出现:为什么的?

您需要登录后才可以回复。登录 | 立即注册