Fix route

parent 94aa404d
...@@ -106,7 +106,7 @@ class App ...@@ -106,7 +106,7 @@ class App
*/ */
public function validateAmka($req, $res, $args) public function validateAmka($req, $res, $args)
{ {
$detailed_info = isset($args['extended']); $detailed_info = isset($args['extended']) && ($args['extended'] == 'extended');
$amka = $args['amka']; $amka = $args['amka'];
$surname = $args['surname']; $surname = $args['surname'];
$bdate = ''; $bdate = '';
...@@ -128,7 +128,7 @@ class App ...@@ -128,7 +128,7 @@ class App
if ($fields_requested) { if ($fields_requested) {
$field_names = explode(',', $fields_requested); $field_names = explode(',', $fields_requested);
} }
$detailed_info = $detailed_info || count($field_names) > 0; $detailed_info = $detailed_info || (count($field_names) > 0);
$this->logger->info("validateAmka::{$amka}"); $this->logger->info("validateAmka::{$amka}");
......
<?php <?php
$app->get('/amka/{amka}/{surname}[/extended]', '\Gr\Gov\Minedu\Osteam\Slim\App:validateAmka'); $app->get('/amka/{amka}/{surname}[/{extended}]', '\Gr\Gov\Minedu\Osteam\Slim\App:validateAmka');
$app->any('/[{anythingelse}]', function ($request, $response, $args) { $app->any('/[{anythingelse}]', function ($request, $response, $args) {
$this->logger->info("Void response, no action route was enabled"); $this->logger->info("Void response, no action route was enabled");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment