Skip to content

Commit 8380b0b

Browse files
author
Slavey Karadzhov
committed
Initial code needed to the manual pages.
1 parent a8a9498 commit 8380b0b

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed

module/Client/config/module.config.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
'webapi-api-controller' => 'Client\Controller\ApiController',
99
'webapi-lib-controller' => 'Client\Controller\LibController',
1010
'client-update-controller' => 'Client\Controller\UpdateController',
11-
)
11+
'client-manual-controller' => 'Client\Controller\ManualController',
12+
)
1213
),
1314
'console' => array (
1415
'router' => array (
@@ -212,6 +213,20 @@
212213
'This command updates the phar file to the latest version.',
213214
),
214215
),
216+
),
217+
218+
'gettingStartedManual' => array(
219+
'options' => array (
220+
'route' => 'getting-started',
221+
'defaults' => array (
222+
'controller' => 'client-manual-controller',
223+
'action' => 'gettingStarted'
224+
),
225+
'group'=>'manual',
226+
'info' => array (
227+
'Run this command to get started with the tool',
228+
),
229+
),
215230
)
216231
),
217232
)
@@ -237,5 +252,11 @@
237252
'invokables' => array(
238253
'repeater' => 'Client\Controller\Plugin\Repeater'
239254
)
255+
),
256+
257+
'view_manager' => array(
258+
'template_path_stack' => array(
259+
__DIR__ .'/../views/',
260+
)
240261
)
241262
);
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
namespace Client\Controller;
3+
use Zend\Mvc\Controller\AbstractActionController;
4+
use Zend\View\Model\ViewModel;
5+
use Zend\Stdlib\ResponseInterface as Response;
6+
use Zend\Stdlib\RequestInterface as Request;
7+
use Zend\View\Renderer\PhpRenderer;
8+
9+
/**
10+
* Manual Pages Controller
11+
*/
12+
class ManualController extends AbstractActionController
13+
{
14+
public function dispatch(Request $request, Response $response = null)
15+
{
16+
$serviceManager = $this->getServiceLocator();
17+
$routeMatch = $this->getEvent()->getRouteMatch();
18+
$viewModel = new ViewModel();
19+
$viewModel->setTemplate('client/manual/'.strtolower($routeMatch->getParam('action')));
20+
if($serviceManager->has('viewrenderer')) {
21+
$renderer = $serviceManager->get('viewrenderer');
22+
} else {
23+
$renderer = new PhpRenderer();
24+
$renderer->setResolver($serviceManager->get('ViewResolver'));
25+
}
26+
27+
return $response->setContent($renderer->render($viewModel));
28+
}
29+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is the getting started ...

0 commit comments

Comments
 (0)