示例#1
0
 */
DSettings::$paths['baseDirectory'] = dirname(__FILE__) . SLASH;
/**
 * This class contains core functionalities of the framework
 * The containing script contains the DFPath() function
 * 
 * @link http://not-ready See the Documentation on the DAmmyCore class
 * @link http://not-ready See how the DFPath() helps with path management
 * @see loadScript()
 */
loadScript('DAmmyCore', 'lib.util');
/**
 * Now loading the framework's internal core scripts and preparing environment
 * 
 */
DAmmyCore::init();
/**
 * Invoking the DBufferHandler(if its been enabled)
 * Its important to start the BufferHandler before any output
 * 
 * @link http://not-ready See the Documentation on the DBufferHandler class
 * @link http://not-ready See the Documentation on the DSettings class
 */
if (DMainPlugin::isPluginLoaded('cacheManager')) {
    cacheManager::startBuffer();
}
/**
 * 5,4,3,2,1....
 */
new main();
//off we go...
<?php

defined('DAMMYFRAMEWORKPHP') or die('Cannot process request!!');
DAmmyCore::autoloadScripts(D_AUTOLOAD_APP, 'home');
//loads the app's model and handler component
class homeView extends DView
{
    private $model;
    function __construct()
    {
        $this->setTemplateResource(DFPath('app.view.templates', 'test.html', false));
        //sets the template file to be used as template
        $this->model = new homeModel();
        //starts the model component that contains the template context
        $this->setTemplateAdapter($this->model->context);
    }
}
new homeView();
//singing, favourite artist(why, met?, date?), want dinner?(no : write some code, yes : Jackpot!)
 public static function init()
 {
     DAmmyCore::autoloadScripts(D_AUTOLOAD_DEFAULT);
     mt_srand((double) microtime() * 1000000);
     //seeding the randomization generator
 }