You do like this:
You create your base dashboard based on our dashboard and in your base dashboard you have an action like this:
use \koolreport\dashboard\Dashboard;
use \koolreport\dashboard\notifications\Alert;
class BaseDashboard extends Dashboard
{
protected function actionInfo($request, $response)
{
return Alert::create()
->title("User Information")
->type("primary")
->sub([
Html::i()->class("fa fa-info-circle"),
Html::b("Anything is posible"),
]);
}
}
Now all of your dashboards will derive from BaseDashboard instead of our original Dashboard
class FinancialBoard extends BaseDashboard
{
...
}
Now all of your dashboard will have actionInfo because it derived from BaseDashboard.
Here is how to show the Info from accountMenu or topMenu
class App extends Application
{
...
protected function accountMenu()
{
return [
"User Info"=>MenuItem::create()
->onClick("dashboardAction('info')"),
"Logout"=>MenuItem::create()
->icon("fa fa-lock")
->onClick(Client::logout())
];
}
...
}
Hope that helps.