AloFramework documentation
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Namespaces

  • Alo
    • Cache
    • Controller
    • Db
    • Exception
    • Session
    • Statics
    • Test
    • Validators
  • Controller
  • None
  • PHP

Classes

  • Cart
  • Sample
  • SampleErrorController
 1 <?php
 2 
 3    namespace Controller;
 4 
 5    use Alo\Controller\AbstractController;
 6 
 7    if (!defined('GEN_START')) {
 8       http_response_code(404);
 9       die();
10    }
11 
12    /**
13     * A sample controller
14     *
15     * @author Art <a.molcanovas@gmail.com>
16     */
17    class Sample extends AbstractController {
18 
19       /**
20        * Default index page
21        *
22        * @author Art <a.molcanovas@gmail.com>
23        */
24       function index() {
25          $this->loadView('sample', ['foo' => 'bar']);
26       }
27 
28       /**
29        * Sample method for a more complex route
30        *
31        * @author Art <a.molcanovas@gmail.com>
32        * @param string $first  The first string to echo
33        * @param string $second The second string to echo
34        */
35       function echoer($first = '[not supplied]', $second = '[not supplied]') {
36          echo 'Your first param was ' . $first . ' and your second was ' . $second;
37       }
38 
39       /**
40        * Sample method for when the class parameter isn't supplied.
41        *
42        * @author Art <a.molcanovas@gmail.com>
43        */
44       function noclass() {
45          echo 'You\'re in the noclass method! Your routed args are ' . implode(', ', func_get_args());
46       }
47 
48       /**
49        * Sample method for the final route test
50        *
51        * @author Art <a.molcanovas@gmail.com>
52        */
53       function noparam() {
54          echo 'You\'re in the no-param method!';
55       }
56 
57       /**
58        * Sample method for showing parameters
59        *
60        * @author Art <a.molcanovas@gmail.com>
61        */
62       function paramed() {
63          $vars = func_get_args();
64          echo 'Your path params are' . ($vars ? ' ' . implode(', ', $vars) : '... not set.');
65       }
66    }
AloFramework documentation API documentation generated by ApiGen 2.8.0