<?php
/**
 * 显示所有的标签
 * @author yzxh24
 * @email yzxh24@gmail.com
 * @created 2010-05-14 15:07:00
 */
class ListAction extends BaseAction
{
    public function run()
    {
        $criteria = new CDbCriteria();
		$pages = new CPagination(Label::model()->count($criteria));
		$pages->pageSize = 50;
		$pages->applyLimit($criteria);

		$sort = new CSort('Label');
		$sort->defaultOrder = 'id DESC';
		$sort->applyOrder($criteria);

		$models = Label::model()->findAll($criteria);

		$this->getController()->render('list', array('models' => $models, 'pages' => $pages, 'sort' => $sort));
    }
}