-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCircuitosController.php
More file actions
34 lines (27 loc) · 951 Bytes
/
CircuitosController.php
File metadata and controls
34 lines (27 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
namespace Funarte;
use MapasCulturais\App;
use MapasCulturais\i;
class CircuitosController extends \MapasCulturais\Controller
{
/**
* Custom route handler for the Funarte theme
*/
public function ALL_index()
{
$app = App::i();
$values = explode(',', $app->config['funarte.circuito_seals']);
// trim whitespace and convert to number if numeric
$numbers = array_map(function($v) {
$v = trim($v);
// convert to integer or float if numeric
return is_numeric($v) ? $v + 0 : $v;
}, $values);
// Filtrar projetos que possuem qualquer um destes selos (operador OR)
$initial_pseudo_query = [
'@seals' => $numbers,
];
$app->applyHookBoundTo($this, 'search-projects-initial-pseudo-query', [&$initial_pseudo_query]);
$this->render('index', ['initial_pseudo_query' => $initial_pseudo_query]);
}
}