|
@@ -56,11 +56,11 @@ |
|
|
block discarded – undo |
|
56
|
56
|
$build = array(); |
|
57
|
57
|
global $base_url; |
|
58
|
58
|
header('Content-Type: application/json'); |
|
59
|
|
- $json_output = (string) $this->httpClient->get($base_url . '/api/node/article')->getBody(); |
|
|
59
|
+ $json_output = (string) $this->httpClient->get($base_url.'/api/node/article')->getBody(); |
|
60
|
60
|
$json_pretty = json_encode(json_decode($json_output), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
|
61
|
61
|
$json_indented_by_2 = preg_replace('/^( +?)\\1(?=[^ ])/m', '$1', $json_pretty); |
|
62
|
62
|
$build['article_node_endpoint_block']['#markup'] = '<a class="btn btn-primary" data-toggle="collapse" href="#collapseCode" role="button" aria-expanded="false" aria-controls="collapseExample">Show/Hide API Response</a> |
|
63
|
|
- <div class="collapse.show" id="collapseCode"><pre><code class="language-json">' . $json_indented_by_2 . '</code></pre></div>'; |
|
|
63
|
+ <div class="collapse.show" id="collapseCode"><pre><code class="language-json">' . $json_indented_by_2.'</code></pre></div>'; |
|
64
|
64
|
$build['article_node_endpoint_block']['#attached']['library'][] = 'df_tools_articles/main'; |
|
65
|
65
|
return $build; |
|
66
|
66
|
} |
Please login to merge, or discard this patch.