1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<?php
class Welcome extends AbstractController {
private $data = [];
public function
__construct () {
$this->data["page_title"] = "Welcome to my Super site!";
}
public function
get_methods () {
return [
"hello" => "hello",
"hello_again" => "hello"
];
}
public function
hello ($args) {
$this->load_view_raw ("header.php", $this->data);
if (count ($args) < 1) {
echo "Too few arguments to the hello () method.";
$this->load_view_raw ("footer.php");
return;
}
echo "Hello " . $args[0];
$this->load_view_raw ("footer.php");
}
public function
default_method ($args) {
$this->load_view_raw ("header.php", $this->data);
$this->load_view ("WelcomeView");
$this->load_view_raw ("footer.php");
}
}
|