/** * @param IterableInterface $iterable * @param string $field * @param string $direction asc or desc * @param null $label * @return string */ public function sort(IterableInterface $iterable, $field, $direction = 'asc', $label = null) { return $this->environment->render($this->sort['template'], array('label' => $label, 'field' => $field, 'direction' => strtolower($direction) == 'desc' ? 'desc' : 'asc', 'query' => $iterable->getQuery())); }
/** * Create a IterableRequest from another IterableInterface instance. * * @param IterableInterface $iterable * @param Request $request * @param FormInterface $form * @return IterableRequest */ public static function fromBaseIterable(IterableInterface $iterable, Request $request, FormInterface $form) { return new self($request, $form, $iterable->getItems(), $iterable->getTotalItems(), $iterable->getCurrentPage(), $iterable->getItemsPerPage()); }