inspect/type: still ugly, debug-only
This commit is contained in:
parent
ccf8e6fa78
commit
7ec900bf9d
|
@ -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()
|
||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue