Commit: 2185ae2dce0c60da3698ceb65a9ca91ae7b02d98

Author: Jon Adams | Date: 2010-03-01 21:11:29 -0800
Added source to method view
diff --git a/controllers/BrowserController.php b/controllers/BrowserController.php index 6c1b061..46f5c22 100644 --- a/controllers/BrowserController.php +++ b/controllers/BrowserController.php @@ -68,7 +68,8 @@ class BrowserController extends \lithium\action\Controller { 'properties' => null, 'parent' => null, 'subClasses' => null, - 'children' => null + 'children' => null, + 'source' => null, ); $object['type'] = Inspector::type($name); @@ -113,6 +114,13 @@ class BrowserController extends \lithium\action\Controller { break; } $object['info'] += (array) Inspector::info($object['identifier']); + + if ($object['type'] == 'method') { + $object['source'] = join("\n", Inspector::lines( + $object['info']['file'], range($object['info']['start'], $object['info']['end']) + )); + } + $object = $this->_process($object); $crumbs = $this->_crumbs($object); diff --git a/views/browser/view.html.php b/views/browser/view.html.php index e03c663..21c4cc7 100644 --- a/views/browser/view.html.php +++ b/views/browser/view.html.php @@ -75,6 +75,14 @@ $curPath = str_replace('\\', '/', $name); </span> <?php } ?> +<?php // Method source ?> +<?php if (isset($object['source'])) { ?> + <h4>Source</h4> + <pre> + <code><?php echo $object['source']; ?></code> + </pre> +<?php } ?> + <?php // Related items ?> <?php if (isset($object['info']['tags']['see'])) { ?> <h4><?=$t('Related', array('scope' => 'li3_docs')); ?></h4>