riddlestone/zf-portals

该包已弃用且不再维护。作者建议使用riddlestone/brokkr-portals包。

一个用于收集门户配置的模块,例如公共门户、管理员门户等。

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

This package is auto-updated.

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


README

一个用于收集门户配置的模块,例如公共门户、管理员门户等。

仓库归档于2020-02-06

此仓库已迁移至riddlestone/brokkr-portals

添加配置

要添加有关门户的信息,请将其添加到portals.{portal_name}下的模块配置文件中

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

或者,如果需要,您可以手动合并新的配置

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

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

获取门户管理器

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

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

获取配置

/** @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();