inc\classes\Pages.php
Pages
Displays content by pages
- Author
- Sergey Dilong
- License
- GPL-2.0
- Package
- Temply-Account\Services
\Pages
Package: Temply-Account\Services





Parameters
Throws

Parameters
Pages class
Cuts and offsets the content
- Author
- Sergey Dilong
- License
- GPL-2.0
Constants
Properties

array<mixed,mixed> $data = array()Data for pagination
Default value
array()Details- Type
- array<mixed,mixed>

array<mixed,mixed> $default_params = array(0, 10, 1, 1)static
Default settings
Default value
array(0, 10, 1, 1)Details- Type
- array<mixed,mixed>

array<mixed,mixed> $default_params_user = array("_", "_", "_", "_")static
User's universal defaults
Default value
array("_", "_", "_", "_")Details- Type
- array<mixed,mixed>

array<mixed,mixed> $id_register = array()static
All IDs
Default value
array()Details- Type
- array<mixed,mixed>

array<mixed,integer> $limits = array(self::SYSTEM_MIN, self::SYSTEM_MAX)Limits for the Pages
Default value
array(self::SYSTEM_MIN, self::SYSTEM_MAX)Details- Type
- array<mixed,integer>

array<mixed,mixed> $p = array()Settings for the object *
Default value
array()Details- Type
- array<mixed,mixed>
Methods

__construct(mixed $data, mixed $id, mixed $limits = array(), mixed $default = array()) : void__construct
Creates Pages object
The Pages object is used to give via API big arrays by parts
| Name | Type | Description |
|---|---|---|
| $data | mixed | The array to display |
| $id | mixed | ID to control the object (could be not just unique) |
| $limits | mixed | Count limits [min, max] |
| $default | mixed | Default rules [offset, count, page, jumpAllowed]. You can fall back to default values using "_" string or by not adding them if they are at the end. |
| Exception | Description |
|---|---|
| \apiException | [104] Wrong rules, critical parse errors |

applyRules(mixed $rules) : voidJust saves the rules
Parameters
| Name | Type | Description |
|---|---|---|
| $rules | mixed | Rules to save |

parseRules(mixed $rules) : voidParse Rules
Checks and autofills given rules
| Name | Type | Description |
|---|---|---|
| $rules | mixed | The rules to work with |