I'd like a block plugin to display content dependent on a GET request. Inside my block plugin I have
class BlogPage extends BlockBase { public function build() { $query = \Drupal::entityQuery('node') ->condition('type', 'blog_post') ->sort('created', 'DESC') ->range(0, $range); return $query; } } I'd like to make $range retrieve info from a GET request. For example I'd like 127.0.0.1/page?range=5 to make $range = 5. I've tried
$range = Request::get('range'); But that does not work. Is there a way to return the values in a GET request from inside the block plugin?