我需要编写php代码来改变我的视图的字段值。我在主题下有一个php模板文件,代码如下:
$view = views_get_view_result("gallery");
$count = count($view);
if ($count>=1) {
$ids = explode(",", $view[0]->nextag_items_tags);
$tagword = "";
foreach ($ids as $id) {
$query = db_select('nextag_words', 'a');
$query->fields('a', array('tagword'));
$query->condition('a.id', $id, '=');
$results = $query->execute()->fetchField();
$tagword .= $results . ",";
}
$view[0]->nextag_words_tagword = $tagword;
//?????? My question is here
}
我的问题是如何将新字段值设置为drupal视图,以便显示更改?这让我困扰了很长时间......
谢谢大家的时间!