Blame view

app/library/App/Bootstrap/RouteBootstrap.php 1.3 KB
15479603   Alex Savenko   initialize
1
2
3
4
5
6
7
8
9
  <?php
  
  namespace App\Bootstrap;
  
  use App\BootstrapInterface;
  use App\Constants\Services;
  use Phalcon\Config;
  use Phalcon\DiInterface;
  use PhalconRest\Api;
b38ef228   Alex Savenko   generate GaResource
10
  
15479603   Alex Savenko   initialize
11
12
13
  
  class RouteBootstrap implements BootstrapInterface
  {
34feae2d   Alex Savenko   test google lib
14
  
15479603   Alex Savenko   initialize
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
      public function run(Api $api, DiInterface $di, Config $config)
      {
          $api->get('/', function() use ($api) {
  
              /** @var \Phalcon\Mvc\View\Simple $view */
              $view = $api->di->get(Services::VIEW);
  
              return $view->render('general/index');
          });
  
          $api->get('/proxy.html', function() use ($api, $config) {
  
              /** @var \Phalcon\Mvc\View\Simple $view */
              $view = $api->di->get(Services::VIEW);
  
              $view->setVar('client', $config->clientHostName);
              return $view->render('general/proxy');
          });
  
          $api->get('/documentation.html', function() use ($api, $config) {
  
              /** @var \Phalcon\Mvc\View\Simple $view */
              $view = $api->di->get(Services::VIEW);
  
b5d15638   Alex Savenko   docs
39
40
              $view->setVar('title', $config->get("application")->title);
              $view->setVar('description', $config->get("application")->description);
34cfbfc0   Alex Savenko   allposition docs
41
              $view->setVar('documentationPath', $config->get("hostName") . ':8080/export/documentation.json');
15479603   Alex Savenko   initialize
42
43
              return $view->render('general/documentation');
          });
15479603   Alex Savenko   initialize
44
      }
39ed17fc   Alex Savenko   test google lib
45
  
15479603   Alex Savenko   initialize
46
  }