/+junk/StupidMVC

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/StupidMVC
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
40
<?php

class WelcomeView extends AbstractView {
  
  public function
  render ($user_data) {
    $this->say_hello ();
    ?>
      <p>
        You could have a try looking at the examle
        <a href="<?=( BASE_URL . "Welcome/hello/Alice" )?>"> here </a> and
        <a href="<?=( BASE_URL . "Welcome/hello/Bob" )?>"> here </a>
      </p>
    <?php
    $this->print_usage ();
  }
  
  private function
  say_hello () {
    echo "<h1> Hello from Welcome.php! </h1>";
  }
  
  private function
  print_usage () {
    ?>
    <h2> Configure </h2>
    <p>
      To configure StupidMVC open up the file <code> <?=(ROOT_DIR  . "index.php ") ?> </code>
      and change the <code> define ("BASE_URL", ...); </code> to the current base url,
      i.e. if your application is accessible from the url 
      <code> http://example.com/myapp </code> then the it should be defied as
      <code> define ("BASE_URL", "http://example.com/myapp"); </code>
    </p>
    <p>
      The application is defined in <code> <?=(APP_DIR)?> </code>.
    </p>
    <?php
  }
  
}