我正在寻找一种在CForm formbuilder数组中显示图像的简单方法。 但我想展示模型内容,如下例所示:
array(
'elements'=>array(
'<img src="$this->thumbnail" />',
'thumbnail'=>array(
'type'=>'file',
),
),
)
这可能吗?
答案 0 :(得分:1)
找到它,这有效。
return array(
'elements'=>array(
'<img src="'.$this->getModel()->thumbnail.'" alt="" />',
'thumbnail'=>array(
'type'=>'file',
),
),
);