alexsawallich/alsa-zf-content

There is no license information available for the latest version (dev-master) of this package.

A ZF2-Module for managing content. Comes with backend and frontend.

dev-master 2016-03-09 18:33 UTC

This package is auto-updated.

Last update: 2024-10-29 03:58:48 UTC


README

AlsaZfContent is a very simple content module for your Zend-Framework >= 2 application.

It ships with a backend for creating, editing and deleting content-items (requires ZfcAdmin for the backend-routes). A content-item is a very simple entity, consisting only of a name, a text-body and a publishing-status. The only task of the frontend is to display a content-item on a single-page, with it's name and text-body.

Dependencies

  • This module requires ZfcAdmin, since it uses the zfcadmin-route for the backend.
  • This module depends on AlsaBase as it uses some of the abstract classes, which can be found there.

These dependencies will be installed by composer.

Installation

  1. Install through composer require alexsawallich/alsazfcontent

  2. Add AlsaZfContent to the modules-key within your application's config/application.config.php-file.

  3. Copy config/alsazfcontent.global.php.dist to your application's config/autoload/alsazfcontent.global.php and adjust to your needs.

Configuration

Adjust configuration of this module to your needs.

<?php
return [
    'alsazfcontent' => [
        /**
         * Name of the class you want to use for content-entities. If you use your
         * own enhanced entity-classes they must extend \AlsaZfCotnent\Entity\Content.
         * 
         * default: '\AlsaZfContent\Entity\Content'
         * 
         * @var string
         */
        'content_entity_name' => \AlsaZfContent\Entity\Content::class,
        
        /**
         * Name of the database-table, where the contents should be stored.
         * 
         * default: content
         * 
         * @var string
         */
        'content_table_name' => 'content',
        
        /**
         * Key of the db-adapter within the service-manager.
         * 
         * default: \Zend\Db\Adapter\Adapter
         * 
         * @var string
         */
        'content_table_adapter_name' => '\Zend\Db\Adapter\Adapter',
    ]
];

Misc.

Styling

Like the Skeleton Application this module uses Twitter Bootstrap for styling. If you don't use Twitter Bootstrap in your application you will probably at least want to overwrite the frontend template to add your own CSS-classes and such.

Therefore you will have to overwrite view/alsa-zf-content/controller/frontend/view.phtml

Translation

The module uses english as its' major language. However wherever a string is displayed to the user ZFs transaltion-features are taken into account, since the translate-view-helper is used within the views. Flashmessages are also translated within the controllers as are form labels. Therefore you need to have a translator-key setup within your application's configuration-file. The text-domain for this module is alsazfcontent. Currently only a german translation is available. You may feel free, to translate this module into your native language and make a pull request.

Enhancement

To enhance functionality you will have to write your own modules, which interact with AlsaZfContent. Therefore AlsZfContent triggers events at particular places, which allow you to hook up with your own module.