选择语言 :

 Core_Form::image

Creates a image form input.

echo Form::image(null, null, array('src' => 'media/img/login.png'));
string Core_Form::image( string $name , string $value [, array $attributes = null ] )
uses
Form::input

参数列表

参数 类型 描述 默认值
$name string Input name
$value string Input value
$attributes array Html attributes null
返回值
  • string
File: ./core/classes/form.class.php
public static function image($name, $value, array $attributes = null)
{
    if (!empty($attributes['src']))
    {
        if (strpos($attributes['src'], '://') === false)
        {
            $attributes['src'] = Core::url($attributes['src']);
        }
    }

    $attributes['type'] = 'image';

    return Form::input($name, $value, $attributes);
}