diff --git a/application/controllers/InspectController.php b/application/controllers/InspectController.php index 500e8111..785f3e4d 100644 --- a/application/controllers/InspectController.php +++ b/application/controllers/InspectController.php @@ -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() diff --git a/application/views/scripts/inspect/type.phtml b/application/views/scripts/inspect/type.phtml new file mode 100644 index 00000000..8884360b --- /dev/null +++ b/application/views/scripts/inspect/type.phtml @@ -0,0 +1,12 @@ +
+tabs ?> +

escape($this->title) ?>

+
+ +
+
+escape(print_r($this->type, 1)) ?>
+
+escape(print_r($this->objects, 1)) ?>
+
+