PHP code example of richardhj / dc-general-single-model

1. Go to this page and download the library: Download richardhj/dc-general-single-model library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

richardhj / dc-general-single-model example snippets


/**
 * DCA
 */
$GLOBALS['TL_DCA'][$table] = [

    // Config
    'config' => [
        'dataContainer' => 'General',
        'forceEdit'     => true,
    ],
    'dca_config'   => [
        'data_provider' => [
            'default' => [
                'class' => 'DcGeneral\Data\SingleModelDataProvider',
            ],
        ],
        'view'          => 'DcGeneral\View\SingleModelView',
    ],


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;
}