alexsawallich / alsa-zf-content
A ZF2-Module for managing content. Comes with backend and frontend.
Requires
- php: >=5.4
- alexsawallich/alsa-base: dev-master
- zendframework/zendframework: >=2.5
- zf-commons/zfc-admin: =v0.2.1
This package is auto-updated.
Last update: 2024-11-29 04:08:30 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
-
Install through composer
require alexsawallich/alsazfcontent
-
Add
AlsaZfContent
to themodules
-key within your application'sconfig/application.config.php
-file. -
Copy
config/alsazfcontent.global.php.dist
to your application'sconfig/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.