li3_docs\controllers\ApiBrowserController::view()

public method

This action renders the detail page for all API elements, including namespaces, classes, properties and methods. The action determines what type of entity is being displayed, and gathers all available data on it. Any wiki text embedded in the data is then post-processed and prepped for display.

Returns

array

Returns an array with the following keys:

  • 'name': A string containing the full name of the entity being displayed
  • 'library': An array with the details of the current class library being browsed, in which the current entity is contained.
  • 'object': A multi-level array containing all data extracted about the current entity.

Source

	public function view() {
		$extractor = $this->_classes['extractor'];
		$config = Libraries::get('li3_docs');

		if (!$library = $extractor::library($this->request->lib)) {
			throw new Exception('Library not found.');
		}
		if (isset($config['index']) && !in_array($this->request->lib, $config['index'])) {
			throw new Exception('Library not found.');
		}
		$name = $library['prefix'] . join('\\', func_get_args());
		$object = $extractor::get($this->request->lib, $name, array(
			'namespaceDoc' => $this->_namespaceDoc
		) +  $library);

		if (!$object) {
			throw new Exception('Object not found.');
		}
		$meta = array();

		if (strpos($name, '::') !== false) {
			list($class, $method) = explode('::', $name, 2);
			$meta = $extractor::get($this->request->lib, $class);
		}
		return compact('name', 'library', 'object', 'meta');
	}