lithium\template\helper\Html::image PHP Method

image() public method

Creates a formatted element.
public image ( string $path, array $options = [] ) : string
$path string Path to the image file. If the filename is prefixed with `'/'`, the path will be relative to the base path of your application. Otherwise the path will be relative to the images directory, usually `app/webroot/img/`. If the name starts with `'http://'`, this is treated as an external url used as the `src` attribute.
$options array Array of HTML attributes.
return string Returns a formatted `` tag.
    public function image($path, array $options = array())
    {
        $defaults = array('alt' => '');
        $options += $defaults;
        $path = is_array($path) ? $this->_context->url($path) : $path;
        $params = compact('path', 'options');
        $method = __METHOD__;
        return $this->_filter($method, $params, function ($self, $params, $chain) use($method) {
            return $self->invokeMethod('_render', array($method, 'image', $params));
        });
    }