You need to change the decorators directly:
$text->getDecorator('Label')->setOption('class', 'my-class-name');
Or you can style the element appropriately using the generated identifier, as Mark suggested. Generally, if you need to apply this to more than one form identifier, do it the way I suggest minimizing the css length and adding some clarity.
source
share