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 ] )
参数列表
参数 类型 描述 默认值 $name
string
Input name $value
string
Input value $attributes
array
Html attributes null
string
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);
}