Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SqlBase.php

function SqlBase::defineOptions

Overrides PluginBase::defineOptions

4 calls to SqlBase::defineOptions()
Full::defineOptions in core/modules/views/src/Plugin/views/pager/Full.php
Information about options for all kinds of purposes will be held here.
Full::defineOptions in core/modules/views/src/Plugin/views/pager/Full.php
Information about options for all kinds of purposes will be held here.
Mini::defineOptions in core/modules/views/src/Plugin/views/pager/Mini.php
Overrides \Drupal\views\Plugin\views\pager\PagerPlugin::defineOptions().
Mini::defineOptions in core/modules/views/src/Plugin/views/pager/Mini.php
Overrides \Drupal\views\Plugin\views\pager\PagerPlugin::defineOptions().
2 methods override SqlBase::defineOptions()
Full::defineOptions in core/modules/views/src/Plugin/views/pager/Full.php
Information about options for all kinds of purposes will be held here.
Mini::defineOptions in core/modules/views/src/Plugin/views/pager/Mini.php
Overrides \Drupal\views\Plugin\views\pager\PagerPlugin::defineOptions().

File

core/modules/views/src/Plugin/views/pager/SqlBase.php, line 65

Class

SqlBase
A common base class for sql based pager.

Namespace

Drupal\views\Plugin\views\pager

Code

protected function defineOptions() {
    $options = parent::defineOptions();
    $options['items_per_page'] = [
        'default' => 10,
    ];
    $options['offset'] = [
        'default' => 0,
    ];
    $options['id'] = [
        'default' => 0,
    ];
    $options['total_pages'] = [
        'default' => '',
    ];
    $options['pagination_heading_level'] = [
        'default' => 'h4',
    ];
    $options['expose'] = [
        'contains' => [
            'items_per_page' => [
                'default' => FALSE,
            ],
            'items_per_page_label' => [
                'default' => $this->t('Items per page'),
            ],
            'items_per_page_options' => [
                'default' => '5, 10, 25, 50',
            ],
            'items_per_page_options_all' => [
                'default' => FALSE,
            ],
            'items_per_page_options_all_label' => [
                'default' => $this->t('- All -'),
            ],
            'offset' => [
                'default' => FALSE,
            ],
            'offset_label' => [
                'default' => $this->t('Offset'),
            ],
        ],
    ];
    $options['tags'] = [
        'contains' => [
            'previous' => [
                'default' => $this->t('‹ Previous'),
            ],
            'next' => [
                'default' => $this->t('Next ›'),
            ],
        ],
    ];
    return $options;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal