Modules/Html

HTML Helpers

The HTML helper classes are available to give you a hand when it comes to rendering some essential "widgets"

Note: In order to use the HTML helpers your core.php file must contain Lepton::using('html');

HtmlHelpers

All the helpers are based on the HtmlHelper class.

HtmlOptionList class?

This is probably the simplest of all the helpers. What it does is simply provides a <select> list with the provided data and a specific item selected.

new HtmlOptionList($selecteditem,array(
  $item => $value,
  ...
));

HtmlBreadcrumbs class?

HtmlTabset class?

The tabset provides basic navigation with exclusive selection. It is wrapped in a <div> element.

new HtmlTabset($selecteditem,array(
   array($item, $text, $url),
   ...
));

HtmlForm class?

HtmlCalendar class?

HtmlTable class

Helps construct and manipulate tables.

$t = new HtmlTable();
$t->addColumn('first','First Column');
$t->addColumn('second','Second Column');
$t->addRow(array(
  first => 'foo',
  second => 'bar'
));

Managing your widgets

You can relay your widgets to the view in one of two ways:

Using the Widgets class

// In global code
$t = new HtmlTabset(...);
Widgets::set('maintabs',$t);

// In the view
Widgets::insert('maintabs');

By passing the widgets as view data

$data['maintabs'] = (string)Site::getNavigation();
$this->loadview(..., $data);