ESP32 Platform Documentation

DashboardModule

Provides base class for modular dashboard modules

To add a module:

  1. Create a file in app/Controllers/Admin/DashboardModules
  2. use 'DashbordModule' suffix for the filename
  3. Make sure the class and filename are equal
  4. The dashboard_helper handles the rest
Tags
example
namespace App\Controllers\Admin\DashboardModules;

use App\Controllers\Admin\DashboardModules\DashboardModule;

class ExampleDashboardModule extends DashboardModule
{
	protected $sort = 5;
	protected $css_class = 'wide';
	//protected $visible = fakse;

	public function index( &$data ) : string
	{
		// example usage of user meta:
		$user_meta = service('user_meta');
		$this->data['meta_data'] = $user_meta->find( 'key' );<br>
		return view('admin/dashboard_modules/example_view', $this->data);
	}
}

Table of Contents

Properties

$css_class  : string
Custom css class
$data  : mixed
Used for the view
$sort  : int
Sort order
$visible  : bool
Visiblity state, default is true

Methods

getCssClass()  : string
Returns custom css class
getSort()  : int
Returns sort order
getVisibility()  : bool
Returns true if module is visible, false if not

Properties

$visible

Visiblity state, default is true

protected bool $visible = true

Methods

getCssClass()

Returns custom css class

public getCssClass() : string
Return values
string

getSort()

Returns sort order

public getSort() : int
Return values
int

getVisibility()

Returns true if module is visible, false if not

public getVisibility() : bool
Return values
bool

        
On this page

Search results