Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 989 Bytes

accessing-image-from-view-templates.md

File metadata and controls

32 lines (24 loc) · 989 Bytes

Access image from view templates

This wiki will show you how to access image from view templates.

Here, is the syntax:

echo $this->htProfileImage($user, $attributes, $options);

Where,

  1. $user is the instance of user entity class of ZfcUser

  2. $attributes is an associative array of attributes to apply to img element. (optional)

  3. $options is associative array of options (optional)

For Example,

echo $this->htProfileImage($this->zfcUserIdentity(), array('class' => 'my-awesome-class'), array('filter' => 'my-awesome-filter')); // 

Note: if filter is not provided, then this will be used as default

This will output something similiar to

<img src='url/of/image' class='my-awesome-class'>

When, you only have user_id, you can also access the image, such as

echo $this->htProfileImage($userId);