drupal 9 how to pass arguments to custom blocks

Solutions on MaxInterview for drupal 9 how to pass arguments to custom blocks by the best coders in the world

showing results for - "drupal 9 how to pass arguments to custom blocks"
Tim
05 Apr 2016
1$block_vals = [
2'campaign_id' => $camp_id, 'campaign_hash' => $camp_hash
3];
4
5// block manager service available in this example at $this->bm 
6$ra = $this->bm->createInstance('your_block_id', $block_vals)->build();
7