Innovative Computer Solutions,
Development & Technical Support

07975 997026 • enquiries[delete-me]@[delete-me]harpanet.com

User Tools

Site Tools


programming:php:codeigniter:dashboard:index

Dashboard Library Notes

Download hDash

Direct Download of master.zip

This library is maintained and available on GitHub (https://github.com/hArpanet/CodeIgniter_hDash).

Installation

  1. Extract the contents of the master.zip file into your CodeIgniter /application/third_party/ folder.
  2. For default configuration, Move or copy hArpanet/hDash/assets folder to your CodeIgniter root folder, eg. /assets (see core file locations below).

NEW Walkthrough

Adding Widgets to a Dashboard

Adding Widgets to a Dashboard

Expected File Locations

By default, hDash expects to find relevant files at:

hDash Core Files

Widget Files

hDash Settings

By default, hDash will generate a 3 column dashboard and look for widget content within /assets.

All defaults can be changed through configuration settings directly within the calling Controller, or globally through the hDash config file.

1. Setting from within your controller:

  $hdash->option = 'value';

2. Setting within hDash configuration file:1)

  $config['option'] = 'value';

hDash Configuration Options

Dashboard Array Structure

Definitions:
A single-content widget is a widget that only contains content from a single source.
A multi-content widget is a widget that contains content from multiple sources.

Dashboard array structure:

Single-content Widget array structure:

Multiple-content Widget array structure:

Widget parameters:

A full example:

Widget type = OOP

When a widget definition has a 'type'⇒'oop', content for that widget will be generated by calling a specified OOP Controller located in the 'oop_path' location. The name of the controller is specified in the 'src' parameter.

The 'oop' type is primarily used when dedicated widget Controllers are created to generate content (a more modular approach). If you have an existing CI application controller you can place a method within your controller to generate widget content if you prefer. In this case you would use the 'html' type (see full example above).

Example:

HOW-TO Create a New Dashboard

  1. A basic dashboard controller method is shown below. Simply include this within an existing application controller to create a new dashboard.
  2. Remember to rename the 'DASHBOARD-NAME' to something relevant.
  3. Create the widget content at the relevant locations and configure the widgets[] array.

See code:

hDash Helper Functions

dash_img_path( [dashboard_name] )

View:

dash_file_path( [dashboard_name] )

View:

FAQ

How can I display images full size?

Q. I have an image that is very wide, but hDash forces it to fit within the widget/popup window. How can I view it full size?

Answer:

1) the hDash config file is located at: /application/third_party/hArpanet/hDash/config/hDash.php
2) , 4) For the most basic widget, you only need to specify a title parameter, which could be useful as a section header.
3) , 5) by default, all widgets are single column width

Comments

yu

1 | 31/07/2015 07:04 |
4768


U J O G F W K S P H J C
programming/php/codeigniter/dashboard/index.txt · Last modified: 03/02/2014 16:33 by harpanet