query->all(); foreach ($variables['content'] as $type) { $variables['types'][$type->id()] = array( 'link' => Link::fromTextAndUrl($type->label(), new Url('entity.fedora_resource.add_form', array( 'fedora_resource_type' => $type->id() ), array('query' => $query))), 'description' => array( '#markup' => $type->label(), ), 'title' => $type->label(), 'localized_options' => array( 'query' => $query, ), ); } }