當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GridField::ID方法代碼示例

本文整理匯總了PHP中GridField::ID方法的典型用法代碼示例。如果您正苦於以下問題:PHP GridField::ID方法的具體用法?PHP GridField::ID怎麽用?PHP GridField::ID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GridField的用法示例。


在下文中一共展示了GridField::ID方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getHTMLFragments

 /**
  * Returns a map where the keys are fragment names and the values are pieces of HTML to add to these fragments.
  * @param GridField $gridField Grid Field Reference
  * @return Array Map where the keys are fragment names and the values are pieces of HTML to add to these fragments.
  */
 public function getHTMLFragments($gridField)
 {
     Requirements::css('gridfieldajaxrefresh/css/GridFieldAjaxRefresh.css');
     Requirements::javascript('gridfieldajaxrefresh/javascript/GridFieldAjaxRefresh.js');
     $data = array('RefreshDelay' => $this->refreshDelay, 'AutoRefresh' => $this->autoRefresh, 'GridFieldID' => $gridField->ID());
     $forTemplate = new ArrayData($data);
     $args = array('ID' => $gridField->ID());
     return array($this->targetFragment => $forTemplate->renderWith('GridFieldAjaxRefresh_Header', $args));
 }
開發者ID:helpfulrobot,項目名稱:silverstripe-gridfieldajaxrefresh,代碼行數:14,代碼來源:GridFieldAjaxRefresh.php

示例2: getColumnContent

 /**
  * HTML for the column, content of the <td> element.
  *
  * @param  \GridField $gridField
  * @param  \DataObject $record - Record displayed in this row
  * @param  string $columnName
  *
  * @return string - HTML for the column. Return NULL to skip.
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     $classes = 'ss-gridfield-editable-row--icon';
     if ($record) {
         $classes .= ' ss-gridfield-editable-row--toggle';
     }
     $openToggleId = 'EditableRowToggles.' . $gridField->ID() . '.' . get_class($record) . '_' . $record->ID;
     if ($this->openNewTogglesOnCreate && Session::get($openToggleId)) {
         $classes .= ' ss-gridfield-editable-row--toggle_start';
     }
     Session::clear($openToggleId);
     return sprintf('<i class="%s"></i>', $classes);
 }
開發者ID:helpfulrobot,項目名稱:milkyway-multimedia-ss-gridfield-utils,代碼行數:22,代碼來源:EditableRow.php


注:本文中的GridField::ID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。