Project DescriptionA simple extension (plus some resources) for managing information boxes on a given page.
To install, simply drag the system folder over the root directory of your
N2F Yverdon installation.
Some Notes
- Inherits the n2f_debug class and thus operates largely the same
- Relies on the n2f_template extensions and a main module (though with basic knowledge you can fix this, we'll make it configurable at some point)
- Automatically adjusts for multiple or single messages
A Quick Example
Inside of the main
page.php file (
~/modules/main/page.php), place the following code (in between $tpl->setFile() and $tpl->render()):
// Make sure we have the extension
n2f_cls::getInstance()->requireExtensions(array('infoboxes'));
// Create our object and throw a few sample messages
$infoboxes = new info_boxes();
$infoboxes->throwError('01', 'Testing errors.', 'somefile.php');
$infoboxes->throwError('01', 'Testing errors.', 'somefile.php');
$infoboxes->throwNotice('01', 'Testing notices.', 'somefile.php');
$infoboxes->throwNotice('01', 'Testing notices.', 'somefile.php');
$infoboxes->throwSuccess('01', 'Testing successes.', 'somefile.php');
$infoboxes->throwSuccess('01', 'Testing successes.', 'somefile.php');
$infoboxes->throwWarning('01', 'Testing warnings.', 'somefile.php');
// Add it to the template
$tpl->setField('infoboxes', $infoboxes);
Then inside of the main
index.tpl file (
~/modules/main/tpl/default/index.tpl) place the following code:
<% $infoboxes->display(); %>
The end result should show up something like this:
