![]() ![]() * Page $next This page's next sibling page, or NullPage if it is the last sibling.† See also $page->next($pageArray). * PageArray $siblings All the sibling pages of this page.† Returns a PageArray. * Page $child The first child of this page. ![]() * PageArray $children All the children (subpages) of this page.* Returns a PageArray. * int $numChildren The number of children (subpages) this page has. * FieldsArray $fields All the Fields assigned to this page (via it's template, same as $page->template->fields). * Template $template The Template object this page is using * Page $rootParent The parent page closest to the homepage (typically used for identifying a section) * PageArray $parents All the parent pages down to the root (homepage). * int $parent_id The numbered ID of the parent page or 0 if none. * Page $parent The parent Page object or a NullPage if there is no parent. * string $httpUrl Same as $page->url, except includes protocol (http or https) and hostname. * string $url The page's URL path from the server's document root (may be the same as the $page->path) * string $path The page's URL path from the homepage (i.e. * string $title The page's title (headline) text * string $name The name assigned to the page, as it appears in the URL * int $id The numbered ID of the current page * Licensed under GNU/GPL v2, see LICENSE.TXT Accessing the related hierarchy of pages (i.e. Providing get/set access to the Page's properties * Page is the class used by all instantiated pages and it provides functionality for: This is how my Page.php header now looks like:ĮDIT: Updated the code example to include the cheatsheet comments: What do you think about it? Btw, my IDE is PHPStorm. I think it would quite useful to include something like this for all the classes also listed in the cheatsheet. My IDE now doesn't show warnings for things like $page->name and even gives me autocompletion. I would like to see some more usage of PHPDoc comments.Īs a quick test I modified the Page class to include comments for all the magic properties, and it works great so far. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |