Studyon Minte9.com
ZF 1.0

Study

New



// plugin
<?php
require_once 'Zend/Registry.php';
require_once 'Zend/View/Helper/Abstract.php';


class Zfsite_View_Helper_Sort extends Zend_View_Helper_Abstract
{
	public function sort($coloumn, $field) {

		return "<a href='" . $this->view->url(array(
			'orderby' => $field,
			'sort' => $this->view->params->sort == 'asc' ? 'desc' : 'asc',
			), null, false) . "'>".$coloumn."</a>";
	}
}


// view
<th><?php echo $this->sort('Article', 'title'); ?></th>