inspect/type: still ugly, debug-only

This commit is contained in:
Thomas Gelf 2015-10-16 22:57:48 +02:00
parent ccf8e6fa78
commit 7ec900bf9d
2 changed files with 25 additions and 2 deletions

View File

@ -29,8 +29,19 @@ class Director_InspectController extends ActionController
public function typeAction()
{
print_r($this->api()->getType($this->params->get('name')));
exit;
$typeName = $this->params->get('name');
$this->view->type = $type = $this->api()->getType($typeName);
if ($type->abstract) {
return;
}
if (! empty($type->fields)) {
$this->view->objects = $this->api()->getObjects(
$typeName,
$type->plural_name,
array_keys((array) $type->fields)
);
}
}
protected function api()

View File

@ -0,0 +1,12 @@
<div class="controls">
<?= $this->tabs ?>
<h1><?= $this->escape($this->title) ?></h1>
</div>
<div class="content">
<pre>
<?= $this->escape(print_r($this->type, 1)) ?>
<?= $this->escape(print_r($this->objects, 1)) ?>
</pre>
</div>