mirror of
https://github.com/processwire/processwire.git
synced 2025-08-13 18:24:57 +02:00
Various phpdoc improvements
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
* This file is licensed under the MIT license
|
||||
* https://processwire.com/about/license/mit/
|
||||
*
|
||||
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
|
||||
* ProcessWire 3.x, Copyright 2019 by Ryan Cramer
|
||||
* https://processwire.com
|
||||
*
|
||||
* #pw-summary Holds ProcessWire configuration settings as defined in /wire/config.php and /site/config.php.
|
||||
@@ -30,7 +30,7 @@
|
||||
* @property FilenameArray $styles Array used by ProcessWire admin to keep track of what stylesheet files its template should load. It will be blank otherwise. Feel free to use it for the same purpose in your own sites. #pw-group-runtime
|
||||
* @property FilenameArray $scripts Array used by ProcessWire admin to keep track of what javascript files its template should load. It will be blank otherwise. Feel free to use it for the same purpose in your own sites. #pw-group-runtime
|
||||
*
|
||||
* @property Paths $urls Items from $config->urls reflect the http path one would use to load a given location in the web browser. URLs retrieved from $config->urls always end with a trailing slash. #pw-group-runtime
|
||||
* @property Paths $urls Items from $config->urls reflect the http path one would use to load a given location in the web browser. URLs retrieved from $config->urls always end with a trailing slash. This is the same as the $urls API variable. #pw-group-runtime #pw-group-URLs
|
||||
* @property Paths $paths All of what can be accessed from $config->urls can also be accessed from $config->paths, with one important difference: the returned value is the full disk path on the server. There are also a few items in $config->paths that aren't in $config->urls. All entries in $config->paths always end with a trailing slash. #pw-group-runtime
|
||||
*
|
||||
* @property string $templateExtension Default is 'php' #pw-group-template-files
|
||||
@@ -202,15 +202,18 @@ class Config extends WireData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the url() method
|
||||
* Get URL for requested resource or module or get all URLs if no argument
|
||||
*
|
||||
* #pw-internal
|
||||
*
|
||||
* @param string|Wire $for Predefined ProcessWire URLs property or module name
|
||||
* @return null|string
|
||||
* @return null|string|Paths
|
||||
* @since 3.0.130
|
||||
*
|
||||
*/
|
||||
public function urls($for) { return $this->url($for); }
|
||||
public function urls($for = '') {
|
||||
return $for === '' ? $this->urls : $this->url($for);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get disk path for requested resource or module
|
||||
@@ -234,15 +237,18 @@ class Config extends WireData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for the path() method
|
||||
* Get disk path for requested resource or module or get all paths if no argument
|
||||
*
|
||||
* #pw-internal
|
||||
*
|
||||
* @param string $for Predefined ProcessWire paths property or module name
|
||||
* @return null|string
|
||||
* @return null|string|Paths
|
||||
* @since 3.0.130
|
||||
*
|
||||
*/
|
||||
public function paths($for) { return $this->path($for); }
|
||||
public function paths($for = '') {
|
||||
return $for === '' ? $this->paths : $this->path($for);
|
||||
}
|
||||
|
||||
/**
|
||||
* List of config keys that are also exported in javascript
|
||||
@@ -419,6 +425,8 @@ class Config extends WireData {
|
||||
* }
|
||||
* ~~~~~
|
||||
*
|
||||
* #pw-group-tools
|
||||
*
|
||||
* @param string|null $minVersion
|
||||
* @return bool
|
||||
* @since 3.0.101
|
||||
@@ -429,9 +437,9 @@ class Config extends WireData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if current ProcessWire version is equal to or newer than given version
|
||||
* Check if current ProcessWire version is equal to or newer than given version, or return current version
|
||||
*
|
||||
* If no version argument is given, it simply returns the current ProcessWire version.
|
||||
* If no version argument is given, it simply returns the current ProcessWire version (3.0.130+)
|
||||
*
|
||||
* ~~~~~
|
||||
* if($config->version('3.0.100')) {
|
||||
@@ -439,20 +447,25 @@ class Config extends WireData {
|
||||
* }
|
||||
* ~~~~~
|
||||
*
|
||||
* #pw-group-tools
|
||||
*
|
||||
* @param string $minVersion Specify version string if you want to compare against current version
|
||||
* @return bool|string Returns current version if no argument given, OR boolean if given a version argument:
|
||||
* @return bool|string Returns current version if no argument given (3.0.130+), OR boolean if given a version argument:
|
||||
* - If given version is older than current, returns false.
|
||||
* - If given version is equal to or newer than current, returns true.
|
||||
* @since 3.0.106
|
||||
* @since 3.0.106 with no-argument behavior added in 3.0.130
|
||||
*
|
||||
*/
|
||||
public function version($minVersion = '') {
|
||||
if($minVersion === '') return $this->version;
|
||||
return version_compare($this->version, $minVersion) >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Was this ProcessWire installation installed after a particular date?
|
||||
*
|
||||
* #pw-group-tools
|
||||
*
|
||||
* @param int|string $date Unix timestamp or strtotime() compatible date string
|
||||
* @return bool
|
||||
* @see Config::installedBefore(), Config::installed
|
||||
@@ -467,6 +480,8 @@ class Config extends WireData {
|
||||
/**
|
||||
* Was this ProcessWire installation installed before a particular date?
|
||||
*
|
||||
* #pw-group-tools
|
||||
*
|
||||
* @param int|string $date Unix timestamp or strtotime() compatible date string
|
||||
* @return bool
|
||||
* @see Config::installedAfter(), Config::installed
|
||||
@@ -477,5 +492,21 @@ class Config extends WireData {
|
||||
if(!ctype_digit("$date")) $date = strtotime($date);
|
||||
return $this->installed < $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the current ProcessWire instance for this object (PW 3.0)
|
||||
*
|
||||
* #pw-internal
|
||||
*
|
||||
* @param ProcessWire $wire
|
||||
*
|
||||
*/
|
||||
public function setWire(ProcessWire $wire) {
|
||||
parent::setWire($wire);
|
||||
$paths = $this->paths;
|
||||
if($paths) $paths->setWire($wire);
|
||||
$urls = $this->urls;
|
||||
if($urls) $urls->setWire($wire);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1160,6 +1160,8 @@ function WireArray($items = array()) {
|
||||
* $data = WireData([ 'hello' => 'world', 'foo' => 'bar' ]);
|
||||
* ~~~~~
|
||||
*
|
||||
* #pw-group-arrays
|
||||
*
|
||||
* @param array|\Traversable $data Can be an associative array or Traversable object of data to set, or omit if not needed
|
||||
* @return WireData
|
||||
* @since 3.0.126
|
||||
|
@@ -1056,7 +1056,7 @@ abstract class Inputfield extends WireData implements Module {
|
||||
*
|
||||
* #pw-group-attribute-methods
|
||||
*
|
||||
* @param string $class Class name you want to remove or specify one of the following:
|
||||
* @param string|array $class Class name you want to remove or specify one of the following:
|
||||
* - Single class name to remove.
|
||||
* - Space-separated class names you want to remove (Since 3.0.16).
|
||||
* - Array of class names you want to remove (Since 3.0.16).
|
||||
|
@@ -14,6 +14,7 @@
|
||||
* #pw-summary Class used by all Page objects in ProcessWire.
|
||||
* #pw-summary-languages Multi-language methods require these core modules: `LanguageSupport`, `LanguageSupportFields`, `LanguageSupportPageNames`.
|
||||
* #pw-summary-system Most system properties directly correspond to columns in the `pages` database table.
|
||||
* #pw-summary-previous Provides access to the previously set runtime value of some Page properties.
|
||||
* #pw-order-groups common,traversal,manipulation,date-time,access,output-rendering,status,constants,languages,system,advanced,hooks
|
||||
* #pw-use-constants
|
||||
* #pw-var $page
|
||||
@@ -28,20 +29,20 @@
|
||||
*
|
||||
* @property int $id The numbered ID of the current page #pw-group-system
|
||||
* @property string $name The name assigned to the page, as it appears in the URL #pw-group-system #pw-group-common
|
||||
* @property string $namePrevious Previous name, if changed. Blank if not. #pw-advanced
|
||||
* @property string $namePrevious Previous name, if changed. Blank if not. #pw-group-previous
|
||||
* @property string $title The page’s title (headline) text
|
||||
* @property string $path The page’s URL path from the homepage (i.e. /about/staff/ryan/)
|
||||
* @property string $url The page’s URL path from the server's document root
|
||||
* @property array $urls All URLs the page is accessible from, whether current, former and multi-language. #pw-group-urls
|
||||
* @property string $httpUrl Same as $page->url, except includes scheme (http or https) and hostname.
|
||||
* @property Page|string|int $parent The parent Page object or a NullPage if there is no parent. For assignment, you may also use the parent path (string) or id (integer). #pw-group-traversal
|
||||
* @property Page|null $parentPrevious Previous parent, if parent was changed. #pw-group-traversal
|
||||
* @property Page|null $parentPrevious Previous parent, if parent was changed. #pw-group-previous
|
||||
* @property int $parent_id The numbered ID of the parent page or 0 if homepage or not assigned. #pw-group-system
|
||||
* @property int $templates_id The numbered ID of the template usedby this page. #pw-group-system
|
||||
* @property PageArray $parents All the parent pages down to the root (homepage). Returns a PageArray. #pw-group-common #pw-group-traversal
|
||||
* @property Page $rootParent The parent page closest to the homepage (typically used for identifying a section) #pw-group-traversal
|
||||
* @property Template|string $template The Template object this page is using. The template name (string) may also be used for assignment.
|
||||
* @property Template|null $templatePrevious Previous template, if template was changed. #pw-advanced
|
||||
* @property Template|null $templatePrevious Previous template, if template was changed. #pw-group-previous
|
||||
* @property Fieldgroup $fields All the Fields assigned to this page (via its template). Returns a Fieldgroup. #pw-advanced
|
||||
* @property int $numChildren The number of children (subpages) this page has, with no exclusions (fast). #pw-group-traversal
|
||||
* @property int $hasChildren The number of visible children this page has. Excludes unpublished, no-access, hidden, etc. #pw-group-traversal
|
||||
@@ -70,7 +71,7 @@
|
||||
* @property string $sortfield Field that a page is sorted by relative to its siblings (default="sort", which means drag/drop manual) #pw-group-system
|
||||
* @property null|array _statusCorruptedFields Field names that caused the page to have Page::statusCorrupted status. #pw-internal
|
||||
* @property int $status Page status flags. #pw-group-system #pw-group-status
|
||||
* @property int|null $statusPrevious Previous status, if status was changed. #pw-group-status
|
||||
* @property int|null $statusPrevious Previous status, if status was changed. #pw-group-status #pw-group-previous
|
||||
* @property string statusStr Returns space-separated string of status names active on this page. #pw-group-status
|
||||
* @property Fieldgroup $fieldgroup Fieldgroup used by page template. Shorter alias for $page->template->fieldgroup (same as $page->fields) #pw-advanced
|
||||
* @property string $editUrl URL that this page can be edited at. #pw-group-urls
|
||||
@@ -85,6 +86,7 @@
|
||||
* @property PageArray $links Return pages that link to this one contextually in Textarea/HTML fields. #pw-group-traversal
|
||||
* @property int $numLinks Total number of pages manually linking to this page in Textarea/HTML fields. #pw-group-traversal
|
||||
* @property int $hasLinks Number of visible pages (to current user) linking to this page in Textarea/HTML fields. #pw-group-traversal
|
||||
* @property int $instanceID #pw-internal
|
||||
*
|
||||
* @property Page|null $_cloning Internal runtime use, contains Page being cloned (source), when this Page is the new copy (target). #pw-internal
|
||||
* @property bool|null $_hasAutogenName Internal runtime use, set by Pages class when page as auto-generated name. #pw-internal
|
||||
@@ -3278,7 +3280,7 @@ class Page extends WireData implements \Countable, WireMatchable {
|
||||
* - Note the return value from this method may be different from the `Page::sortfield` (lowercase) property,
|
||||
* as this method considers the sort field specified with the template as well.
|
||||
*
|
||||
* #pw-group-internal
|
||||
* #pw-group-system
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
|
@@ -1362,9 +1362,11 @@ class Pages extends Wire {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Pages API methods specific to generating and modifying page names
|
||||
*
|
||||
* @return PagesNames
|
||||
*
|
||||
* #pw-internal
|
||||
* #pw-advanced
|
||||
*
|
||||
*/
|
||||
public function names() {
|
||||
|
@@ -193,7 +193,7 @@ class PagesLoader extends Wire {
|
||||
* - `stopBeforeID` (int): Stop loading pages once page matching this ID is found (default=0).
|
||||
* - `startAfterID` (int): Start loading pages once page matching this ID is found (default=0).
|
||||
* - loadOptions: array - Optional assoc array of options to pass to getById() load options.
|
||||
* @return PageArray
|
||||
* @return PageArray|array
|
||||
*
|
||||
*/
|
||||
public function find($selector, $options = array()) {
|
||||
|
@@ -6,6 +6,20 @@
|
||||
* ProcessWire 3.x, Copyright 2019 by Ryan Cramer
|
||||
* https://processwire.com
|
||||
*
|
||||
* #pw-summary This class includes methods for generating and modifying page names.
|
||||
* #pw-body =
|
||||
* While these methods are mosty for internal core use, some may at times be useful from the public API as well.
|
||||
* You can access methods from this class via the Pages API variable at `$pages->names()`.
|
||||
* ~~~~~
|
||||
* if($pages->names()->pageNameExists('something')) {
|
||||
* // A page named “something” exists
|
||||
* }
|
||||
*
|
||||
* // generate a globally unique random page name
|
||||
* $name = $pages->names()->uniqueRandomPageName();
|
||||
* ~~~~~
|
||||
* #pw-body
|
||||
*
|
||||
*/
|
||||
|
||||
class PagesNames extends Wire {
|
||||
@@ -66,8 +80,10 @@ class PagesNames extends Wire {
|
||||
/**
|
||||
* Assign a name to given Page (if it doesn’t already have one)
|
||||
*
|
||||
* @param Page $page
|
||||
* @param string $format
|
||||
* #pw-group-manipulators
|
||||
*
|
||||
* @param Page $page Page to setup a new name for
|
||||
* @param string $format Optional format string to use for name
|
||||
* @return string Returns page name that was assigned
|
||||
*
|
||||
*/
|
||||
@@ -99,6 +115,8 @@ class PagesNames extends Wire {
|
||||
/**
|
||||
* Does the given page have an auto-generated name (during this request)?
|
||||
*
|
||||
* #pw-group-informational
|
||||
*
|
||||
* @param Page $page
|
||||
* @return string|bool Returns auto-generated name if present, or boolean false if not
|
||||
*
|
||||
@@ -112,6 +130,8 @@ class PagesNames extends Wire {
|
||||
/**
|
||||
* Does the given page have a modified “name” during this request?
|
||||
*
|
||||
* #pw-group-informational
|
||||
*
|
||||
* @param Page $page
|
||||
* @param bool|null $set Specify boolean true or false to set whether or not it has an adjusted name, or omit just to get
|
||||
* @return bool
|
||||
@@ -123,7 +143,9 @@ class PagesNames extends Wire {
|
||||
}
|
||||
|
||||
/**
|
||||
* Is given page name an untitled page name?
|
||||
* Does the given page have an untitled page name?
|
||||
*
|
||||
* #pw-group-informational
|
||||
*
|
||||
* @param string $name
|
||||
* @return bool
|
||||
@@ -140,6 +162,8 @@ class PagesNames extends Wire {
|
||||
* Returns array like `[ 'name', 123 ]` where `name` is name without the suffix, and `123` is the numbered suffix.
|
||||
* If the name did not have a numbered suffix, then the 123 will be 0 and `name` will be the given `$name`.
|
||||
*
|
||||
* #pw-group-informational
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $delimiter Character(s) that separate name and numbered suffix
|
||||
* @return array
|
||||
@@ -159,6 +183,8 @@ class PagesNames extends Wire {
|
||||
/**
|
||||
* Does the given name or Page have a number suffix? Returns the number if yes, or false if not
|
||||
*
|
||||
* #pw-group-informational
|
||||
*
|
||||
* @param string|Page $name
|
||||
* @param bool $getNamePrefix Return the name prefix rather than the number suffix? (default=false)
|
||||
* @return int|bool|string Returns false if no number suffix, or int for number suffix or string for name prefix (if requested)
|
||||
@@ -174,6 +200,8 @@ class PagesNames extends Wire {
|
||||
/**
|
||||
* Get the name format string that should be used for given $page if no name was assigned
|
||||
*
|
||||
* #pw-group-informational
|
||||
*
|
||||
* @param Page $page
|
||||
* @param array $options
|
||||
* - `fallbackFormat` (string): Fallback format if another cannot be determined (default='untitled-time').
|
||||
@@ -244,6 +272,8 @@ class PagesNames extends Wire {
|
||||
* For formats above that accept a wireDate() format, see `WireDateTime::date()` method for format details. It accepts PHP
|
||||
* date() format, PHP strftime() format, as well as some other predefined options.
|
||||
*
|
||||
* #pw-group-generators
|
||||
*
|
||||
* @param Page $page
|
||||
* @param string|array $format Optional format. If not specified, pulls from $page’s parent template.
|
||||
* @param array $options Options to modify behavior. May also be specified in $format argument.
|
||||
@@ -385,6 +415,8 @@ class PagesNames extends Wire {
|
||||
* The returned value is not yet assigned to the given $page, so if it is something different than what
|
||||
* is already on $page, you’ll want to assign it manually after this.
|
||||
*
|
||||
* #pw-group-generators
|
||||
*
|
||||
* @param string|Page|array $name Name to make unique
|
||||
* You may optionally substitute the $page argument or $options arguments here, if that is all you need.
|
||||
* @param Page||string|null|array Page to exclude from duplicate check and/or to pull $name or parent from (if not otherwise specified).
|
||||
@@ -468,6 +500,8 @@ class PagesNames extends Wire {
|
||||
/**
|
||||
* If name exceeds maxLength, truncate it, while keeping any numbered suffixes in place
|
||||
*
|
||||
* #pw-group-manipulators
|
||||
*
|
||||
* @param string $name
|
||||
* @param int $maxLength
|
||||
* @return string
|
||||
@@ -515,6 +549,8 @@ class PagesNames extends Wire {
|
||||
/**
|
||||
* Increment the suffix of a page name, or add one if not present
|
||||
*
|
||||
* #pw-group-manipulators
|
||||
*
|
||||
* @param string $name
|
||||
* @param int|null $num Number to use, or omit to determine and increment automatically
|
||||
* @return string
|
||||
@@ -553,6 +589,8 @@ class PagesNames extends Wire {
|
||||
* If the `multilang` option is used, it checks if the page name exists in any language.
|
||||
* IF the `language` option is used, it only checks that particular language (regardless of `multilang` option).
|
||||
*
|
||||
* #pw-group-informational
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $options
|
||||
* - `page` (Page|int): Ignore this Page or page ID
|
||||
@@ -624,6 +662,8 @@ class PagesNames extends Wire {
|
||||
/**
|
||||
* Get a random, globally unique page name
|
||||
*
|
||||
* #pw-group-generators
|
||||
*
|
||||
* @param array $options
|
||||
* - `page` (Page): If name is or should be assigned to a Page, specify it here. (default=null)
|
||||
* - `length` (int): Required/fixed length, or omit for random length (default=0).
|
||||
@@ -698,6 +738,8 @@ class PagesNames extends Wire {
|
||||
/**
|
||||
* Return the untitled page name string
|
||||
*
|
||||
* #pw-group-informational
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
@@ -710,6 +752,8 @@ class PagesNames extends Wire {
|
||||
*
|
||||
* In multi-language environment this applies to default language only.
|
||||
*
|
||||
* #pw-group-informational
|
||||
*
|
||||
* @param Page $page Page to check
|
||||
* @return string|bool Returns string with conflict reason or boolean false if no conflict
|
||||
* @throws WireException If given invalid $options argument
|
||||
@@ -761,6 +805,8 @@ class PagesNames extends Wire {
|
||||
/**
|
||||
* Check given page’s name for conflicts and increment as needed while also triggering a warning notice
|
||||
*
|
||||
* #pw-group-manipulators
|
||||
*
|
||||
* @param Page $page
|
||||
* @since 3.0.127
|
||||
*
|
||||
|
@@ -1,50 +1,91 @@
|
||||
<?php namespace ProcessWire;
|
||||
|
||||
/**
|
||||
* ProcessWire Paths
|
||||
* ProcessWire configuration paths and URLs
|
||||
*
|
||||
* Maintains lists of file paths, primarily used by the ProcessWire configuration.
|
||||
* #pw-headline Configuration paths and URLs (Paths class)
|
||||
* #pw-summary Maintains lists of file paths or URLs, primarily used by the ProcessWire $config->paths and $urls API variables.
|
||||
* #pw-summary-paths-only These properties are only useful when accessed from `$config->paths` as they are not HTTP accessible as URLs.
|
||||
* #pw-summary-urls-only These properties apply only to the `$urls` or `$config->urls`. Do not use them with `$config->paths`.
|
||||
* #pw-summary-pagination These properties apply only to the `$urls` or `$config->urls` and only when pagination is active for the current request.
|
||||
*
|
||||
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
|
||||
* #pw-body =
|
||||
* The Paths class is used by `$config->paths` and `$config->urls`. The `$config->paths` refers to server disk paths
|
||||
* while `$config->urls` refers to web server URLs. All of the same properties are present on both, though several properties
|
||||
* are only useful on one or the other (as outlined below). You can access a path or URL like this:
|
||||
* ~~~~~
|
||||
* $path = $config->paths->templates; // i.e. /path/to/htdocs/site/templates/
|
||||
* $url = $config->urls->templates; // i.e. /site/templates/
|
||||
* ~~~~~
|
||||
* The `$config->urls` property can also be accessed more directly via the `$urls` API variable (in PW 3.x+):
|
||||
* ~~~~~
|
||||
* $url = $urls->templates; // i.e. /site/templates/
|
||||
* ~~~~~
|
||||
* For `$config->urls` (or `$urls`), if you prepend `http` to any of the property names (making it camelCase) it will
|
||||
* return the full http/https URL rather then the relative URL:
|
||||
* ~~~~~
|
||||
* $httpUrl = $config->urls->httpTemplates; // i.e. https://domain.com/site/templates/
|
||||
* $httpUrl = $urls->httpTemplates; // same as above
|
||||
* ~~~~~
|
||||
* You may optionally add your own properties as well. If you add a path/url without a leading slash “/” it is assumed to
|
||||
* be relative to the `root` property. If it has a leading slash, then it is absolute.
|
||||
* ~~~~~
|
||||
* // add new urls properties
|
||||
* $urls->set('css', 'site/templates/css/'); // relative to site root
|
||||
* $urls->set('uikit', '/uikit/dist/'); // absolute
|
||||
*
|
||||
* // get properties that were set
|
||||
* echo $urls->get('css'); // i.e. /site/templates/css/
|
||||
* echo $urls->get('uikit'); // i.e. /uikit/dist/
|
||||
* echo $urls->get('httpCss'); // i.e. https://domain.com/site/templates/css/
|
||||
* echo $urls->get('httpUikit'); // i.e. https://domain.com/uikit/dist/
|
||||
* echo $urls->httpUikit; // same as above (using get method call is optional for any of these)
|
||||
* ~~~~~
|
||||
* Do not set `http` properties directly, as they are dynamically generated from `urls` properties at runtime upon request.
|
||||
*
|
||||
* In the examples on this page, you can replace the `$urls` variable with `$config->paths` if you need to get the server path
|
||||
* instead of a URL. As indicated earlier, `$urls` can aso be accessed at the more verbose `$config->urls` if you prefer.
|
||||
*
|
||||
* #pw-body
|
||||
*
|
||||
* ProcessWire 3.x, Copyright 2019 by Ryan Cramer
|
||||
* https://processwire.com
|
||||
*
|
||||
* This file is licensed under the MIT license
|
||||
* https://processwire.com/about/license/mit/
|
||||
*
|
||||
* @see http://processwire.com/api/variables/config/ Offical $config API variable Documentation
|
||||
*
|
||||
* @property string $root Site root: /
|
||||
* @property string $root Site root: / (or subdirectory if site not at domain root)
|
||||
* @property string $templates Site templates: /site/templates/
|
||||
* @property string $fieldTemplates Site field templates /site/templates/fields/
|
||||
* @property string $adminTemplates Admin theme template files: /wire/templates-admin/ or /site/templates-admin/
|
||||
* @property string $fieldTemplates Site field templates /site/templates/fields/ #pw-group-paths-only
|
||||
* @property string $adminTemplates Admin theme template files: /wire/templates-admin/ or /site/templates-admin/ #pw-internal
|
||||
* @property string $modules Core modules: /wire/modules/
|
||||
* @property string $siteModules Site-specific modules: /site/modules/
|
||||
* @property string $core ProcessWire core files: /wire/core/
|
||||
* @property string $site ProcessWire site files /site/
|
||||
* @property string $assets Site-specific assets: /site/assets/
|
||||
* @property string $cache Site-specific cache: /site/assets/cache/
|
||||
* @property string $logs Site-specific logs: /site/assets/logs/
|
||||
* @property string $cache Site-specific cache: /site/assets/cache/ #pw-group-paths-only
|
||||
* @property string $logs Site-specific logs: /site/assets/logs/ #pw-group-paths-only
|
||||
* @property string $files Site-specific files: /site/assets/files/
|
||||
* @property string $tmp Temporary files: /site/assets/tmp/
|
||||
* @property string $sessions Session files: /site/assets/sessions/
|
||||
* @property string $tmp Temporary files: /site/assets/tmp/ #pw-group-paths-only
|
||||
* @property string $sessions Session files: /site/assets/sessions/ #pw-group-paths-only
|
||||
*
|
||||
* The following properties are only in $config->urls
|
||||
* ==================================================
|
||||
* @property string $admin Admin URL
|
||||
* @property string|null $next URL to next pagination of current page, when applicable (populated by MarkupPagerNav, after render)
|
||||
* @property string|null $prev URL to previous pagination of current page, when applicable (populated by MarkupPagerNav, after render)
|
||||
* @property string $admin Admin URL #pw-group-urls-only
|
||||
* @property string|null $next URL to next pagination of current page, when applicable (populated by MarkupPagerNav, after render) #pw-group-urls-only #pw-group-pagination
|
||||
* @property string|null $prev URL to previous pagination of current page, when applicable (populated by MarkupPagerNav, after render) #pw-group-urls-only #pw-group-pagination
|
||||
*
|
||||
* The following are in $config->urls and equivalent to previously mentioned properties, but include scheme + host
|
||||
* ===============================================================================================================
|
||||
* @property string $httpRoot
|
||||
* @property string $httpTemplates
|
||||
* @property string $httpAdminTemplates
|
||||
* @property string $httpModules
|
||||
* @property string $httpSiteModules
|
||||
* @property string $httpAssets
|
||||
* @property string $httpFiles
|
||||
* @property string $httpNext
|
||||
* @property string $httpPrev
|
||||
* @property-read string $httpRoot Full http/https URL to site root (i.e. https://domain.com/). #pw-group-urls-only
|
||||
* @property-read string $httpTemplates Full http/https URL to site templates (i.e. https://domain.com/site/templates/). #pw-group-urls-only
|
||||
* @property-read string $httpAdminTemplates Full http/https URL to admin templates. #pw-internal
|
||||
* @property-read string $httpModules Full http/https URL to core (wire) modules. #pw-group-urls-only
|
||||
* @property-read string $httpSiteModules Full http/https URL to site modules. #pw-group-urls-only
|
||||
* @property-read string $httpAssets Full http/https URL to site assets (i.e. https://domain.com/site/assets/). #pw-group-urls-only
|
||||
* @property-read string $httpFiles Full http/https URL to site assets files (i.e. https://domain.com/site/assets/files/). #pw-group-urls-only
|
||||
* @property-read string $httpNext Full http/https URL to next pagination of current page (when applicable). #pw-group-urls-only #pw-group-pagination
|
||||
* @property-read string $httpPrev Full http/https URL to prev pagination of current page (when applicable). #pw-group-urls-only #pw-group-pagination
|
||||
*
|
||||
* The "http" may be optionally prepended to any property accessed from $config->urls (including those you add yourself).
|
||||
*
|
||||
@@ -74,6 +115,8 @@ class Paths extends WireData {
|
||||
/**
|
||||
* Given a path, normalize it to "/" style directory separators if they aren't already
|
||||
*
|
||||
* #pw-internal
|
||||
*
|
||||
* @static
|
||||
* @param string $path
|
||||
* @return string
|
||||
@@ -86,12 +129,14 @@ class Paths extends WireData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the given path key
|
||||
* Set a new path/URL location
|
||||
*
|
||||
* #pw-group-methods
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value If the first character of the provided path is a slash, then that specific path will be used without modification.
|
||||
* If the first character is anything other than a slash, then the 'root' variable will be prepended to the path.
|
||||
* @return this
|
||||
* @return Paths|WireData
|
||||
*
|
||||
*/
|
||||
public function set($key, $value) {
|
||||
@@ -104,7 +149,9 @@ class Paths extends WireData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the requested path variable
|
||||
* Return the requested path or URL (functionally the same as direct access)
|
||||
*
|
||||
* #pw-group-methods
|
||||
*
|
||||
* @param object|string $key
|
||||
* @return mixed|null|string The requested path variable
|
||||
|
@@ -539,10 +539,10 @@ class WireDateTime extends Wire {
|
||||
* @param int|string $start Starting timestamp or date/time string.
|
||||
* @param int|string $stop Ending timestamp or date/time string, or omit for now.
|
||||
* @param bool|int|array $abbreviate
|
||||
* - Specify boolean FALSE for verbose elapsed time string without abbreviations.
|
||||
* - Specify boolean FALSE for verbose elapsed time string without abbreviations (default).
|
||||
* - Specify boolean TRUE for abbreviations (abbreviated where common, not always different from non-abbreviated).
|
||||
* - Specify integer 1 for extra short abbreviations (all terms abbreviated into shortest possible string).
|
||||
* - Specify integer 0 for digital elapsed time string like “00:01:12” referring to hours:minutes:seconds (default).
|
||||
* - Specify integer 0 for digital elapsed time string like “00:01:12” referring to hours:minutes:seconds.
|
||||
* @param array $options Additional options:
|
||||
* - `delimiter` (string): String to separate time periods (default=' ').
|
||||
* - `exclude` (array|string): Exclude these periods, one or more of: 'seconds', 'minutes', 'hours', 'days', 'weeks' (default=[])
|
||||
|
Reference in New Issue
Block a user