skeeks/cms-related-handler-extra

Related property handler for skeeks cms

1.2.0 2024-01-16 14:34 UTC

This package is auto-updated.

Last update: 2024-10-16 16:33:39 UTC


README

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist skeeks/cms-related-handler-extra "*"

or add

"skeeks/cms-related-handler-extra": "*"

Configuration app

'components' =>
[
    'cms' =>
    [
        'relatedHandlers' => [
            'skeeks\cms\rhExtra\RelatedHandlerExtra' =>
            [
                'class' => 'skeeks\cms\rhExtra\RelatedHandlerExtra'
            ]
        ],
    ],

    'i18n' => [
        'translations' =>
        [
            'skeeks/rh/extra' => [
                'class'             => 'yii\i18n\PhpMessageSource',
                'basePath'          => '@skeeks/cms/rhExtra/messages',
                'fileMap' => [
                    'skeeks/rh/extra' => 'main.php',
                ],
            ]
        ]
    ]
],

How to use

<? if ($extra = $model->relatedPropertiesModel->getAttribute('extra')) : ?>
    <? foreach($extra as $row) : ?>
        <p>
            <strong><?= \yii\helpers\ArrayHelper::getValue($row, 'name'); ?>:</strong> <?= \yii\helpers\ArrayHelper::getValue($row, 'value'); ?>
        </p>
    <? endforeach; ?>
<? endif; ?>

##Links

skeeks!
SkeekS CMS (Yii2) — quickly, easily and effectively!
skeeks.com | en.cms.skeeks.com | cms.skeeks.com | marketplace.cms.skeeks.com