Procedural File: function.pnicon.php
Source Location: /pnRender/plugins/function.pnicon.phpClasses:
Page Details:
Zikula Application FrameworkTags:
smarty_function_pnicon [line 61]
|
Smarty function to provide easy access to an image
This function provides an easy way to include an image. The function will return the full source path to the image. It will as well provite the width and height attributes if none are set.
Available parameters:
- type: The type of image to render (example: save)
- size: The size of the image (extrasmall - small - large - default:extrasmall)
- width, height: If set, they will be passed. If none is set, they are obtained from the 'size' parameter
- alt: If not set, an empty string is being assigned
- altml: If true then alt string is assumed to be a ML constant
- title: If not set, an empty string is being assigned
- titleml: If true then title string is assumed to be a ML constant
- assign: If set, the results are assigned to the corresponding variable instead of printed out
- optional If set then the plugin will not return an error if an image is not found
- default If set then a default image is used should the requested image not be found (Note: full path required)
- all remaining parameters are passed to the image tag
Example: <!--[pnicon type="save" width="100" border="1" alt="foobar" ]--> Output: <img src="images/icons/extrasmall/save.png" width="100" border="1" alt="foobar" />
If the parameter assign is set, the results are assigned as an array. The components of this array are the same as the attributes of the img tag; additionally an entry 'imgtag' is set to the complete image tag.
Example: <!--[pnicon src="heading.gif" assign="myvar"]--> <!--[$myvar.src]--> <!--[$myvar.width]--> <!--[$myvar.imgtag]-->
Output: modules/Example/pnimages/eng/heading.gif 261 <img src="modules/Example/pnimages/eng/heading.gif" alt="" width="261" height="69" />
Tags:
Parameters
| array | $params | All attributes passed to this function from the template |
| object | &$smarty | Reference to the Smarty object |
