/+junk/StupidMVC

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/StupidMVC

« back to all changes in this revision

Viewing changes to Application/Views/WelcomeView.php

  • Committer: Gustav Hatvigsson
  • Date: 2016-03-18 08:58:23 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20160318085823-fiegqlfi14e237bn
* Made the WelcomeView.php use functions for different parts of the
  rendering.
* Added an expliantion on how to use StupidMVC
* Chaned the BASE_URL to something more sane.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
  
5
5
  public function
6
6
  render ($user_data) {
7
 
    echo "<h1> Hello from Welcome.php! </h1>";
 
7
    $this->say_hello ();
8
8
    ?>
9
9
      <p>
10
10
        You could have a try looking at the examle
12
12
        <a href="<?=( BASE_URL . "Welcome/hello/Bob" )?>"> here </a>
13
13
      </p>
14
14
    <?php
 
15
    $this->print_usage ();
 
16
  }
 
17
  
 
18
  private function
 
19
  say_hello () {
 
20
    echo "<h1> Hello from Welcome.php! </h1>";
 
21
  }
 
22
  
 
23
  private function
 
24
  print_usage () {
 
25
    ?>
 
26
    <h2> Configure </h2>
 
27
    <p>
 
28
      To configure StupidMVC open up the file <code> <?=(ROOT_DIR  . "index.php ") ?> </code>
 
29
      and change the <code> define ("BASE_URL", ...); </code> to the current base url,
 
30
      i.e. if your application is accessible from the url 
 
31
      <code> http://example.com/myapp </code> then the it should be defied as
 
32
      <code> define ("BASE_URL", "http://example.com/myapp"); </code>
 
33
    </p>
 
34
    <p>
 
35
      The application is defined in <code> <?=(APP_DIR)?> </code>.
 
36
    </p>
 
37
    <?php
15
38
  }
16
39
  
17
40
}