Pages::from()

Object instantiator.

Table of Contents
  1. Description
  2. Example

Description

Pages::from(iterable $value = []): self;
Pages::from(string $folder = LOT . D . 'page', string $x = 'page', int|true $deep = 0): self;

It is just a shortcut for the Pages::__construct() way.

Example

$pages = Pages::from([
    '.\lot\page\article\article-1.page',
    '.\lot\page\article\article-2.page',
    '.\lot\page\article\article-3.page'
]);

The example above is the same as the instantiation below:

$pages = new Pages([
    '.\lot\page\article\article-1.page',
    '.\lot\page\article\article-2.page',
    '.\lot\page\article\article-3.page'
]);

This method also takes an argument in the form of a folder path, along with other arguments such as those found in the g() function:

$pages = Pages::from('.\lot\page\article');

Pages::from()

Object instantiator.