Page::from()
Object instantiator.
Table of Contents
Description
Page::from(...$lot): self;It is just a shortcut for the Page::__construct() way.
Example
$page = Page::from('.\lot\page\article.page');The example above is the same as the instantiation below:
$page = new Page('.\lot\page\article.page');Its purpose is to help you avoid using parentheses when you want to call a method directly from the class instance to minimize variable usage:
// Syntax error, unexpected token “->”, expecting “)”
$title = new Page('.\lot\page\article.page')->title();
// :(
$page = new Page('.\lot\page\article.page');
$title = $page->title();
$title = (new Page('.\lot\page\article.page'))->title(); // :\
$title = Page::from('.\lot\page\article.page')->title(); // :)Page::URL()
Gets the page URL.
Page::_()
The dynamic method initiator.
Page::__call()
Proxy for missing methods.
Page::__construct()
The constructor.
Page::__get()
Gets a page property.
Page::__isset()
Checks if a page property returns non-null value.
Page::__set()
Sets a page property.
Page::__toString()
Proxy for the current object, casted as a string.
Page::__unset()
Deletes a page property via property access.
Page::_seal()
Gets the file permissions as numeric mode.
Page::_size()
Gets the file sizes in bytes.
Page::children()
Gets the page’s children pages.
Page::content()
Gets the page content.
Page::count()
Counts number of lines in the file content.
Page::exist()
Checks if the page exists.
Page::from()
Object instantiator.
Page::getIterator()
The external iterator receiver.
Page::jsonSerialize()
Returns the JSON version of the page data.
Page::name()
Gets the page name.
Page::offsetExists()
Checks if a page property exists.
Page::offsetGet()
Gets a page property.
Page::offsetSet()
Sets a page property.
Page::offsetUnset()
Deletes a page property.
Page::parent()
Gets the page’s parent page.
Page::route()
Returns the page’s relative path.
Page::seal()
Gets the file permissions as an octal value.
Page::size()
Gets the file sizes in human readable string format.
Page::stream()
Streams the file content chunk by chunk.
Page::time()
Gets the page creation time.
Page::type()
Gets the page type.
Page::x()
Gets the file extension.