@@ 30-52 (lines=23) @@ | ||
27 | $app = new \Anax\MVC\CApplicationBasic($di); |
|
28 | ||
29 | // Home route |
|
30 | $app->router->add('', function () use ($app) { |
|
31 | ||
32 | $app->theme->setTitle("Testing CForm with Anax"); |
|
33 | $app->views->add('default/page', [ |
|
34 | 'title' => "Try out a form using CForm", |
|
35 | 'content' => "This is a example showing how to use CForm with Anax MVC, you must have CForm loaded as part of Anax MVC to make this frontcontroller work.", |
|
36 | 'links' => [ |
|
37 | [ |
|
38 | 'href' => $app->url->create('test1'), |
|
39 | 'text' => "Form as a route", |
|
40 | ], |
|
41 | [ |
|
42 | 'href' => $app->url->create('form'), |
|
43 | 'text' => "Form as a controller", |
|
44 | ], |
|
45 | [ |
|
46 | 'href' => $app->url->create('form-small'), |
|
47 | 'text' => "Form as own class, used by a controller", |
|
48 | ], |
|
49 | ], |
|
50 | ]); |
|
51 | ||
52 | }); |
|
53 | ||
54 | ||
55 |
@@ 16-38 (lines=23) @@ | ||
13 | ||
14 | ||
15 | // Home route |
|
16 | $app->router->add('', function () use ($app) { |
|
17 | ||
18 | $app->theme->setTitle("Throw exceptions to generate HTTP error pages"); |
|
19 | $app->views->add('default/page', [ |
|
20 | 'title' => "Throw exceptions to generate HTTP error pages", |
|
21 | 'content' => "Testcases for exception to generate HTTP error pages.", |
|
22 | 'links' => [ |
|
23 | [ |
|
24 | 'href' => $app->url->create('403'), |
|
25 | 'text' => "\Anax\Exception\ForbiddenException() as 403", |
|
26 | ], |
|
27 | [ |
|
28 | 'href' => $app->url->create('404'), |
|
29 | 'text' => "\Anax\Exception\NotFoundException() as 404", |
|
30 | ], |
|
31 | [ |
|
32 | 'href' => $app->url->create('500'), |
|
33 | 'text' => "\Anax\Exception\InternalServerErrorException() as 500", |
|
34 | ], |
|
35 | ] |
|
36 | ]); |
|
37 | ||
38 | }); |
|
39 | ||
40 | ||
41 |