public function ObjectLogController::objectDetails in Object Log 8
Display a stored object.
Parameters
string $label: The name associated with the stored object.
Return value
array A Drupal render array.
Throws
\Symfony\Component\HttpKernel\Exception\NotFoundHttpException
1 string reference to 'ObjectLogController::objectDetails'
File
- src/
Controller/ ObjectLogController.php, line 135 - Contains \Drupal\object_log\Controller\ObjectLogController.
Class
- ObjectLogController
- Contains callbacks for Object Log routes.
Namespace
Drupal\object_log\ControllerCode
public function objectDetails($label) {
$log = object_log_retrieve($label);
if (!$log) {
throw new NotFoundHttpException();
}
$object = $log->data;
$build = array(
'#type' => 'container',
'#attributes' => array(
'class' => array(
'object_wrapper',
),
),
);
$build['title'] = array(
'#plain_text' => $label,
'#prefix' => '<h4 class="object-label">',
'#suffix' => '</h4>',
);
$build['object'] = array(
'#type' => 'markup',
'#markup' => kpr($object, TRUE, NULL),
'#prefix' => '<div class="object">',
'#suffix' => '</div>',
);
$build['listing'] = $this
->listing();
return $build;
}