WireApiDocs::get()

Get API docs

Return value depends on given $get argument:

  • With no arguments, this method returns array.
  • With an array argument, it returns an array.
  • With a string argument, it returns a string
  • Array return values always indexed by class name.

Example

$api = $wire->docs(); // get instance

// array return values
$api->get(); // get summary array of all documented classes
$api->get(['Pages']); // get docs array for single class
$api->get(['Pages', 'Fields']); // get docs array for multiple classes
$api->get(['Fieldtype*']); // get summary array for classes matching wildcard

// string return values
$api->get('') // get names of all documented classes
$api->get('Pages'); // get docs string for a single class
$api->get('Fieldtype*'); // get names of all classes matching wildcard

// example of "docs array" return value
return [
  'Pages' => 'Full Pages docs in markdown format…',
  'Page' => 'Full Page docs in markdown format…',
   ...
];

// example of "summary array" return value
return [
  'Pages' => 'Summary of Pages',
  'Page' => 'Summary of Page', …
];

// example of "summary string" return value
return
  "Pages: Summary of Pages class \n" .
  "Page: Summary of Page class \n …";

// example of "docs string" return value
return "Full API docs in markdown format…"

Usage

// basic usage
$array = $wireApiDocs->get();

// usage with all arguments
$array = $wireApiDocs->get($get = []);

Arguments

NameType(s)Description
$get (optional)array string

Return value

array string


WireApiDocs methods and properties

API reference based on ProcessWire core version 3.0.264