Skip to content
EvanDotPro edited this page Sep 21, 2012 · 13 revisions

RFC Status: Accepted

RFC Author(s): Jurian Sluiman

Abstract

ZfcAdmin will be a placeholder for administrative activities of various ZF2 modules. The "management" or "admin" part of the different modules can be combined into one view ("unified admin interface"). This centralize management of the different modules and can be beneficial for:

  • One direct access control mechanism whether a user can access the "admin" or not (good for security)
  • One view in which users can perform all kind of the same backoffice like activities (good for user experience)
  • One module to which all modules obey (good for standardization)

The idea of ZfcAdmin is based on an already existing module EnsembleAdmin for the content management framework ensemble. When ZfcAdmin will be in place, EnsembleAdmin will be refactored to make use of ZfcAdmin.

Proposed Features

Through the router configuration key modules will be able to create child routes for the admin route. Besides routes, a navigation configuration key will be present for navigation purposes. Pages can hook into the admin route and admin navigation by providing a configuration that will be merged into the application config.

Various events will be triggered to make sure it is flexible to extend at several points.

Main features of ZfcAdmin will be:

  1. Provide navigation facility to access admin-aware modules
  2. Provide an optional admin layout
  3. Provide a placeholder controller to make /admin accessible by default

Expected Dependencies

No hard dependencies are required for ZfcAdmin. The module does leverage Zend\Permission\Acl with the BjyAuthorize module. When BjyAuthorize is installed and enabled, the /admin is protected for guests. For example ZfcUserAdmin can supply forms and logic to add roles to users to let them access ZfcAdmin.

Existing / Similar Modules

Example(s)

As use cases, a hypothetic ZfcUserAdmin is used.

Use case #1 -- Create child route of admin

'router' => array(
  'routes' => array(
    'zfcadmin' => array(
      'child_routes' => array(
        'zfcuser' => array(
          'type' => 'literal',
          'options' => array(
            'route'    => '/user',
            'defaults' => array(
              'controller' => 'ZfcUserAdmin\Controller\UserController',
              'action'     => 'index',
            ),
          ),
        ),
      ),
    ),
  ),
),

Use case #2 -- Create page in admin navigation

'navigation' => array(
  'zfcadmin' => array(
    array(
      'label' => 'User management',
      'route' => 'zfcadmin/zfcuser'
    ),
  ),
),

Use case #3 -- Disable default layout, or change the default layout

'zfc_admin' => array(
  'use_admin_layout'  => true,
  'admin_layout_name' => 'layout/another-admin'
)

Use case #4 -- Set default admin "homepage" or "dashboard"

'router' => array(
  'routes' => array(
    'zfcadmin' => array(
      'options' => array(
        'defaults' => array(
          'controller' => 'MyPersonalAdmin\Controller\AdminController',
          'action'     => 'other',
        ),
      ),
    ),
  ),
),

Votes

Comments

Click here to view comments and discussion for this RFC.

A prototype of ZfcAdmin is currently located at juriansluiman/ZfcAdmin.