Location: PHPKode > scripts > phpBoing > phpboing/example.php
<?php
/*
 * 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 <hide@address.com>
 */
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
Tools::loadClassPath(CLASSPATH);

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

$container=null;
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");
$simpleExample->printMessage();
?>
Return current item: phpBoing