/**
  * @param  GridField   $gridField
  * @param  DataObject  $record
  * @param  string      $columnName
  * @return bool|string
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     if ($record instanceof DataObjectPreviewInterface) {
         return $this->previewer->preview($record);
     } else {
         return false;
     }
 }
 /**
  * @param  array  $properties
  * @return string
  */
 public function Field($properties = array())
 {
     Requirements::javascript(DATAOBJECTPREVIEW_DIR . '/js/DataObjectPreviewer.js');
     return $this->previewer->preview($this->record);
 }
コード例 #3
0
ファイル: Slice.php プロジェクト: heyday/silverstripe-slices
 /**
  * Used in templates to get a iframe preview of the slice
  *
  * @return string
  */
 public function getPreview()
 {
     return $this->previewer->preview($this);
 }