riddlestone/zf-portals

This package is abandoned and no longer maintained. The author suggests using the riddlestone/brokkr-portals package instead.

A module to pull configuration together for portals, such as a public portal, an admin portal, etc.

v1.1.0 2019-11-30 13:02 UTC

This package is auto-updated.

Last update: 2020-02-06 13:27:24 UTC


README

A module to pull configuration together for portals, such as a public portal, an admin portal, etc.

Repository archived 2020-02-06

This repository has moved to riddlestone/brokkr-portals.

Adding Configuration

To add information about a portal, add it to a module configuration file under portals.{portal_name}:

return [
    'portals' => [
        'main' => [
            'layout' => 'main.layout',
            'resources' => [
                __DIR__ . '/../css/styles.css',
                __DIR__ . '/../js/scripts.js',
            ],
        ],
    ],
];

Alternatively, you can merge new configuration in manually if needed:

/** @var \Riddlestone\ZF\Portals\PortalManager $portalManager */

$portalManager->mergeConfig(
    [
        'main' => [
            'resources' => [
                'another.css',
            ],
        ],
    ]
);

Getting the Portal Manager

/** @var \Zend\ServiceManager\ServiceManager $serviceManager */

$portalManager = $serviceManager->get(\Riddlestone\ZF\Portals\PortalManager::class);

Getting Configuration

/** @var \Riddlestone\ZF\Portals\PortalManager $portalManager */

# get a list of portals
$portals = $portalManager->getPortalNames();

# get the current portal name
$portal = $portalManager->getCurrentPortalName();

# get the config for a portal
$portalConfig = $portalManager->getPortalConfig('main');

# get the config for the current portal
$portalConfig = $portalManager->getCurrentPortalConfig();