summaryrefslogtreecommitdiff
path: root/example/index.php
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2014-05-24 01:54:04 +0200
committerKevin Chabowski <kevin@kch42.de>2014-05-24 01:54:04 +0200
commitf7ddc264d832d163494904da67ca96856335487b (patch)
tree68e1b25d4799a966242150082a9ff3a12832b561 /example/index.php
parent84d815f4e006e02521759070bb89025dab80b219 (diff)
downloadste-f7ddc264d832d163494904da67ca96856335487b.tar.gz
ste-f7ddc264d832d163494904da67ca96856335487b.tar.bz2
ste-f7ddc264d832d163494904da67ca96856335487b.zip
Simple autoloader for examples and tests.
Diffstat (limited to 'example/index.php')
-rw-r--r--example/index.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/example/index.php b/example/index.php
index b8a6938..a0aa03c 100644
--- a/example/index.php
+++ b/example/index.php
@@ -2,11 +2,12 @@
# Example program to demonstrate the STE...
-require_once(dirname(__FILE__) . "/../ste.php");
+require_once(dirname(__FILE__) . "/../steloader.php");
+use \kch42\ste;
# Initialize an STECore instance
-$ste = new \ste\STECore(
- new \ste\FilesystemStorageAccess( # The STECore needs a StorageAccess implementation, we are using the FilesystemStorageAccess, which comes with STE.
+$ste = new ste\STECore(
+ new ste\FilesystemStorageAccess( # The STECore needs a StorageAccess implementation, we are using the FilesystemStorageAccess, which comes with STE.
dirname(__FILE__) . "/templates/src", # FilesystemStorageAccess needs a directory, where the Templates are...
dirname(__FILE__) . "/templates/transc" # ...and a directory for the transcompiled templates (write permissions needed).
)
@@ -32,7 +33,7 @@ $ste->register_tag("repeat",
{
$output = "";
if(!is_numeric($params["n"]))
- throw new \ste\RuntimeError("Sorry, but parameter n must be a number...");
+ throw new ste\RuntimeError("Sorry, but parameter n must be a number...");
for($i = 0; $i < $params["n"]; ++$i)
$output .= $sub($ste);