コード例 #1
0
ファイル: phex.php プロジェクト: nahime/ph.ex
            $thisitem = $item[0];
            $nextitem = $item[1];
            return $recursive ? array($thisitem => self::set($nextitem, $value, true)) : (self::$P[$thisitem] = self::set($nextitem, $value, true));
        } else {
            return $recursive ? array($item => $value) : (self::$P[$item] = $value);
        }
    }
    /**
    		Show an error
    			@param $code integer
    	**/
    static function error($code)
    {
        switch ($code) {
            case 404:
                header('HTTP/1.0 404 Not Found');
                echo "NOT FOUND";
                break;
            default:
                break;
        }
        exit;
    }
}
/**
	Default configuration
**/
phex::set('AUTOLOAD', '');
phex::set('VERSION', '0.0.2');
phex::set('ACCEPTED_METHODS', array('GET', 'POST'));
コード例 #2
0
ファイル: index.php プロジェクト: nahime/ph.ex
<?php

require_once '../lib/phex.php';
function test()
{
    echo "This is a test";
}
phex::set('TEST.ARRAY.VAR.VAR2', "valoresss");
phex::set('NOARRAY', "valore");
//phex::config('config.ini');
phex::routeGET("test", "/", function () {
    phex_tpl::serve("template.html");
});
//phex::route("test", "/", "example::test");
phex::route("test", "/@test1/ciao/test2", 'test');
phex::route("test", "/@test1/@plutone/@test2", 'test');
phex::route("test", "/@test1/ciao/@test2", 'test');
phex::run();
//echo phex::get('INI_ARRAY.TEST');