Class: Blacklight::Response::PaginationComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/blacklight/response/pagination_component.rb

Overview

Render a pagination widget for search results

Constant Summary

Constants inherited from Component

Component::EXCLUDE_VARIABLES

Instance Method Summary collapse

Methods inherited from Component

compiler, config, #inspect

Constructor Details

#initialize(response:, html: {}, **pagination_args) ⇒ PaginationComponent

Returns a new instance of PaginationComponent.

Parameters:

  • response (Blacklight::Response)
  • html (Hash) (defaults to: {})

    html options for the pagination container



9
10
11
12
13
# File 'app/components/blacklight/response/pagination_component.rb', line 9

def initialize(response:, html: {}, **pagination_args)
  @response = response
  @html = html
  @pagination_args = pagination_args
end

Instance Method Details

#html_attrObject



15
16
17
# File 'app/components/blacklight/response/pagination_component.rb', line 15

def html_attr
  { aria: { label: t('views.pagination.aria.container_label') } }.merge(@html)
end

#paginationObject



19
20
21
# File 'app/components/blacklight/response/pagination_component.rb', line 19

def pagination
  helpers.paginate @response, **Blacklight::Engine.config.blacklight.default_pagination_options, **@pagination_args
end