lists = new \stdClass(); // Load the model /** @var \Awf\Mvc\DataModel $model */ $model = $this->getModel(); // We want to persist the state in the session $model->savestate(1); // Ordering information $this->lists->order = $model->getState('filter_order', $model->getIdFieldName(), 'cmd'); $this->lists->order_Dir = $model->getState('filter_order_Dir', 'DESC', 'cmd'); // Display limits $this->lists->limitStart = $model->getState('limitstart', 0, 'int'); $this->lists->limit = $model->getState('limit', 0, 'int'); // Assign items to the view $this->items = $model->get(); $this->itemsCount = $model->count(); // Pagination $displayedLinks = 10; $this->pagination = new Pagination($this->itemsCount, $this->lists->limitStart, $this->lists->limit, $displayedLinks, $this->container->application); return true; } }