首页 > 代码库 > yii gridview columns value 内容如何换行 & 链接

yii gridview columns value 内容如何换行 & 链接

array(
‘header‘ => ‘返回的服务器信息‘,
‘name‘ => ‘return_server_info‘,
‘value‘ => ‘str_replace("^", "<br />", $data->return_server_info)‘,
‘type‘ => ‘raw‘,
‘htmlOptions‘ => array(
‘style‘ =>‘word-break: break-all; word-wrap:break-word;width:20%‘,
),
),

 

type 必填  htmlOptions 必填

value  里需要明确的换行符. 

 

 

array(
‘header‘ => ‘用户名‘,
‘name‘ => ‘username‘,
‘type‘ => ‘raw‘,
‘value‘ => ‘CHtml::link($data->username, array("/admin/user/index", "username" => $data->username), array("target" => "_blank"))‘,
),