Skip to content
Snippets Groups Projects
Commit 1024b96a authored by alangrafu's avatar alangrafu
Browse files

Including params in base variable for special URIs

Also, displaying results when there is only one class in special/index
parent 2171e6bf
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,7 @@ class SpecialFunction extends AbstractSpecialFunction{
}
$data['query'] =$queryHeader . $query;
$data['results'] = $e->query($data['query'], Utils::getResultsType($query));
$data['params'] = $params;
Utils::processDocument($uri, $acceptContentType, $data, $viewFile);
}catch (Exception $ex){
Utils::send500($uri);
......@@ -68,3 +69,4 @@ class SpecialFunction extends AbstractSpecialFunction{
}
?>
......@@ -102,6 +102,9 @@ class Utils{
$base['this']['value'] = $uri;
$base['this']['curie'] = Utils::uri2curie($uri);
$base['ns'] = $conf['ns'];
if(isset($data['params'])){
$base['this']['params'] = $data['params'];
}
require('lib/Haanga/lib/Haanga.php');
Haanga::configure(array(
'template_dir' => './',
......@@ -206,8 +209,9 @@ class Utils{
}else{
$results = Utils::serializeByQueryType($data, $extension);
}
Utils::showView($uri, $results, $viewFile);
$baseData['uri'] = $uri;
$baseData['params'] = $data['params'];
Utils::showView($baseData, $results, $viewFile);
exit(0);
}
......@@ -226,3 +230,4 @@ class Utils{
}
?>
......@@ -10,6 +10,10 @@
<body>
<h1>Instances of {{base.this.curie}}</h1>
<ul>
{% if r.value.resource != null %}
<!-- Only one class available -->
<li><a href='{{base.baseUrl}}special/instances/{{ r.curie.resource }}'>{{r.curie.resource}}</a></li>
{% endif %}
{% for row in r %}
{% if row.value.resource != null %}
<li><a href='{{base.baseUrl}}special/instances/{{ row.curie.resource }}'>{{row.curie.resource}}</a></li>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment