Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Drupal 9 how to pass arguments to custom blocks

$block_vals = [
'campaign_id' => $camp_id, 'campaign_hash' => $camp_hash
];

// block manager service available in this example at $this->bm 
$ra = $this->bm->createInstance('your_block_id', $block_vals)->build();
 
PREVIOUS NEXT
Tagged: #Drupal #pass #arguments #custom #blocks
ADD COMMENT
Topic
Name
7+7 =