如何在Drupal 7主题中向硬编码图像添加属性

I am using

<?php echo theme('image', array('path' => drupal_get_path('theme', 'themename') .'/img/demo.png')); ?>

To hard code images into my Drupal 7 theme. My question is how do I add attributes like "id", "class" or "alt"?

To add extra attributes, you pass an array attributes with the necessary key => value pair. Identical for the alt attribute.

For example:

print theme('image', array(
    'path' => drupal_get_path('theme', 'themename') . '/img/demo.png',
    'alt' => 'my alt content',
    'attributes' => array(
        'id' => 'myId',
        'class' => 'myClass',
    ))
);