2014-01-16 31 views
4

我使用視圖php通過添加自定義php代碼字段到我的視圖顯示,所以我有$data變量可用。裏面的自定義的PHP代碼,我的渲染已添加一個字段集合關係字段:如何使用視圖php創建一個鏈接來編輯視圖內節點的特定字段值?

<?php 
global $user; 
$html = array(); 

if (count($data->field_field_poi_link) > 0) $html[] = 'foobar'; 

if ($user->uid != 0 && arg(0) == 'node' && node_access('update', 'foobar', $user)) { 
    $nid = arg(1); 
    // $html[] = '<a class="inl_edit" href="'.$data->_entity_properties['url'].'/edit?destination=node/'.$nid.'">edit</a>'; 
    // $html[] = '<a class="inl_del" href="'.$data->_entity_properties['url'].'/delete?destination=node/'.$nid.'">delete</a>'; 
} 
print join("\n",$html); 

?> 

於1月10日的$data->_entity_properties陣列實體API更新之前包含在此:

'_entity_properties' => 
    array (
    'url' => 'http://localhost:8888/project/field-collection/field-poi-link/39', 
), 

但現在,它沒有包含那樣的東西。我不能編輯一個特定的條目。

如何創建一個鏈接,爲每個字段集合的輸入字段數據編輯一個特定值,例如http://localhost:8888/project/field-collection/field-pois/74/edit在views php字段中?

回答

相關問題