PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of David Palmer   phpBoing   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: a brief example of usage
Class: phpBoing
Inject dependency objects from XML definitions
Author: By
Last change:
Date: 13 years ago
Size: 990 bytes


Class file image Download
 * This is an example to illustrate how to use PHP Boing. Please
 * note that this is a very simple example. For a more sophisticated
 * example, look into 'ref_app' (reference application) - which is a
 * full blown MVC web application framework, that uses phpBoing.
 * author: David Palmer <>
include_once("config.php"); // defines our core constants we need
include_once("c_container.php"); // phpBoing itself
include_once("c_tools.php"); // separate tool/utility functions

// lets make sure our dependent class definitions are loaded

// lets initialize our cache system
$memcache = Tools::initCache();

try {
$container = new Container(); // instantiate our container class
} catch (Exception $ex) {
// do something with exception
// now lets call our simple example bean:
$smipleExample = $container->getBean("simpleExample");