I'm using this code to add a cancel button to my form. The link is generated through #markup
:
$form['actions']['cancel'] = array(
'#markup' => l(t('Cancel'), $destination),
'#weight' => 20,
);
I'd like to add a class, cancel
, to the link. I tried adding this line:
'#attributes' => array('class' => array('cancel')),
but the class is not added. I'm guessing because #attributes
cannot modify #markup
? How can I add the class in this case?