Skip to content

pbRelationship

Snippet for relationship output

Parameters

ParameterDefaultDescription
relation_typeone_to_oneType of relationship. Possible values: one_to_one, one_to_many, many_to_one, many_to_many
primary_tablepbTablePrimary table. Possible values: pbTable, pbResources
primary_idID of the primary record
limit10Number of records displayed. 0 - means without limits.
offset0Skipping values from the start
sortbymenuindexSort field
sortdirASCSort order
tplChunk for blocks. By default, it is used from the block itself.
returnchunkOutput format of values. Possible values: chunk, data or array, json
toPlaceholderName of the placeholder where the data will be displayed

Examples

php
{'!pbRelationship' | snippet: [
    'relation_type' => 'one_to_one',
    'primary_table' => 'pbTable',
    'primary_id' => 1,
    'tpl' => 'relation',
]}

© PageBlocks 2019-present