Exemplo n.º 1
0
<?php

require_once '../raxan/pdi/autostart.php';
// system configuration
Raxan::loadConfig('config.php');
// load external config file
Raxan::config('site.timezone', 'America/Toronto');
// set timezone
class SearchBoxPage extends RaxanWebPage
{
    protected $db;
    protected $infoTpl, $searchTpl;
    protected function _init()
    {
        $this->source('views/searchbox.html');
        try {
            // see config.php for connection info
            // For employee sample data visit http://dev.mysql.com/doc/
            $this->db = $this->Raxan->connect('employees');
            // connect to db
        } catch (Exception $e) {
            $this->db = null;
            $msg = $this->getView('connection-failed.html');
            $this->flashmsg($msg, 'bounce', 'rax-box error');
        }
    }
    protected function _load()
    {
        // event to handle employee click
        $this->results->delegate('a', '#click', '.employeeClick');
        // event to handle auto-complete search
Exemplo n.º 2
0
 function testLoadConfig()
 {
     Raxan::loadConfig('myconfig.php');
     $v = Raxan::config('custom.key');
     $this->compare('value1', $v, 'Load custom config value');
 }