You are here

public static function EntityBrowserPagerElement::getCurrentPage in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 src/Element/EntityBrowserPagerElement.php \Drupal\entity_browser\Element\EntityBrowserPagerElement::getCurrentPage()

Gets current page from the form state.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: Form state.

Return value

int Current page.

3 calls to EntityBrowserPagerElement::getCurrentPage()
EntityBrowserPagerElement::processEntityBrowserPager in src/Element/EntityBrowserPagerElement.php
Process Entity browser pager element.
EntityBrowserPagerElement::submitPager in src/Element/EntityBrowserPagerElement.php
Submit handler for next and previous buttons.
PagerTestWidget::getForm in tests/modules/entity_browser_test/src/Plugin/EntityBrowser/Widget/PagerTestWidget.php
Returns widget form.

File

src/Element/EntityBrowserPagerElement.php, line 119

Class

EntityBrowserPagerElement
Provides an Entity Browser pager form element.

Namespace

Drupal\entity_browser\Element

Code

public static function getCurrentPage(FormStateInterface $form_state) {
  return !empty($form_state
    ->get('page')) ? $form_state
    ->get('page') : 1;
}