Skip to content

AppGini Helper SimpleDashboard PHP Library

Installation

  1. After purchasing a license ...
  2. Extract AppGiniHelperSimpleDashboard.php from the downloaded ZIP file into resources/lib directory
  3. Paste the following code into hooks/home-custom.php
    (create the file, if not exists)
    1
    2
    3
    <?php
    // file: hooks/home-custom.php
    AppGiniHelperSimpleDashboard::create()->render();
    

This will render a different homepage layout

Change Background

Background-Color

1
2
3
4
5
<?php
// file: hooks/home-custom.php
AppGiniHelperSimpleDashboard::create()
    ->setBackgroundColor('gray')
    ->render();

Background-Image

1
2
3
4
5
6
<?php
// file: hooks/home-custom.php
AppGiniHelperSimpleDashboard::create()
    ->setBackgroundColor('gray')
    ->setBackgroundImageURL('https://source.unsplash.com/random/1024x768/?dark,plant,rainforest')
    ->render();

Table Items Alignment

->setTableAlignment('left'|'center'|'right');

Left

1
2
3
4
AppGiniHelperSimpleDashboard::create()
    ->setBackgroundImageURL('https://source.unsplash.com/random/1024x768/?dark,plant,rainforest')
    ->setTableAlignment("left")
    ->render();

Center

1
2
3
4
AppGiniHelperSimpleDashboard::create()
    ->setBackgroundImageURL('https://source.unsplash.com/random/1024x768/?dark,plant,rainforest')
    ->setTableAlignment("center")
    ->render();

1
2
3
4
AppGiniHelperSimpleDashboard::create()
    ->setBackgroundImageURL('https://source.unsplash.com/random/1024x768/?dark,plant,rainforest')
    ->setTableAlignment("right")
    ->render();

Table Items Image Size

You can change the size of the table icons (images). By default, they are 32px. The function expects a string. This can be any valid CSS size like '24px' or '2em'

->setTableImageSize('16px');

1
2
3
4
5
AppGiniHelperSimpleDashboard::create()
    ->setBackgroundImageURL('https://source.unsplash.com/random/1024x768/?dark,plant,rainforest')
    ->setTableAlignment("left")
    ->setTableImageSize("1.5em")
    ->render();

We recommend not to use sizes larger than 32px.

Filter Table Groups

When reading table groups, the library considers user permissions automatically. However, if you want to hide certain table group from being displayed, you can define a filter-function:

1
2
3
4
5
6
7
8
AppGiniHelperSimpleDashboard::create()
    ->setTableGroupFilter(function($name) {
        if ($name=="Validation")
            return false;
        else
            return true;
    })
    ->render();

Note that PHP's == -operator is case-sensitive.

Filter Tables

When reading tables, the library considers user permissions automatically. However, if you want to hide certain tables from being displayed, you can define a filter-function:

1
2
3
4
5
6
7
8
AppGiniHelperSimpleDashboard::create()
    ->setTableFilter(function ($name) {
        if ($name == "orderimport")
            return false;
        else
            return true;
    })
    ->render();

Note that $name contains the table's name, not the table's caption.

Note that PHP's == -operator is case-sensitive.

In AppGini, by default, there is no top navigation bar on homepage. You can insert the navbar by settings showNavMenu to true .

->setShowNavMenu(true);

Container-Width

1
2
3
4
5
AppGiniHelperSimpleDashboard::create()
    ->setBackgroundColor('gray')
    ->setBackgroundImageURL('https://source.unsplash.com/random/1024x768/?dark,plant,rainforest')
    ->setRemoveGaps(true)
    ->render();

Note the smaller gaps on the left hand side and on the right hand side. This may help if you have many table groups.