GitHub

Advanced customizations

For deeper integration, it is possible to override methods in the \AdminNeo\Admin class. This can be done in the adminneo-instance.php file. The file structure will be:

– adminneo.php
– adminneo-instance.php

You can freely rename adminneo.php to index.php.

The file adminneo-instance.php will return a custom instance derived from \AdminNeo\Admin:

<?php

class CustomAdmin extends \AdminNeo\Admin
{
    public function getServiceTitle()
    {
        return "Custom Service";
    }
}

// Use the factory method to create the CustomAdmin instance.
return CustomAdmin::create();

Factory method create() accepts also configuration and plugins, so everything can be defined in one adminneo-instance.php file:

<?php

class CustomAdmin extends \AdminNeo\Admin
{
    public function getServiceTitle()
    {
        return "Custom Service";
    }
}

// Define configuration.
$config = [
    "colorVariant" => "green",
    "navigationMode": "dual",
    "preferSelection": true,
    "recordsPerPage": 70,
];

// Enable plugins.
$plugins = [
    new \AdminNeo\JsonPreviewPlugin(),
    new \AdminNeo\XmlDumpPlugin(),
    new \AdminNeo\FileUploadPlugin("data/"),
];

// Use the factory method to create the CustomAdmin instance.
return CustomAdmin::create($config, $plugins);

Interface