View source
<?php
namespace Drupal\workspace\Element;
use Drupal\Core\Render\Element\RenderElement;
class Rev extends RenderElement {
public function getInfo() {
$class = get_class($this);
return [
'#pre_render' => [
[
$class,
'preRenderRev',
],
],
];
}
public static function preRenderRev($element) {
$info = [
'#uuid' => $element['#uuid'],
'#rev' => $element['#rev'],
'#rev_info' => $element['#rev_info'],
'#theme' => 'workspace_rev',
];
$renderer = \Drupal::service('renderer');
$element['#markup'] = $renderer
->render($info);
return $element;
}
}