richardhj / dc-general-single-model
DcGeneral DataProvider and View for single model DCAs.
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:contao-module
Requires
- php: ^5.3 || ^7.0
- contao-community-alliance/dc-general: ^2.0
This package is auto-updated.
Last update: 2022-02-01 13:02:03 UTC
README
This package provides a data provider and view for the DcGeneral. You can use it if your dca has to handle one dataset exactly – if you do not need a list view, just the edit mask. It is great to get rid of the DC_File.
Install
Via Composer
$ composer require richardhj/dc-general-single-model
Usage
For extension developers.
DCA
Minimum dca configuration
/** * DCA */ $GLOBALS['TL_DCA'][$table] = [ // Config 'config' => [ 'dataContainer' => 'General', 'forceEdit' => true, ], 'dca_config' => [ 'data_provider' => [ 'default' => [ 'class' => 'DcGeneral\Data\SingleModelDataProvider', ], ], 'view' => 'DcGeneral\View\SingleModelView', ],
The extension create a database table (with key=>value structure) on its when using the database installer.
Model
A model for accessing data
namespace MagickImages\Model; use DcGeneral\Contao\Model\AbstractSingleModel; /** * @property string $implementation */ class Config extends AbstractSingleModel { /** * {@inheritdoc} */ protected static $strTable = 'tl_magickimages_config'; /** * {@inheritdoc} */ protected static $objInstance; }