| Conditions | 5 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | function indexAction() { |
||
|
|
|||
| 13 | //$_GET['search'] |
||
| 14 | $this->view->setTitle('Поиск по сайту'); |
||
| 15 | $map = []; |
||
| 16 | if (!empty($_GET['search']) && is_string($_GET['search'])) { |
||
| 17 | |||
| 18 | $modules = Module::getInstalled(App::$primary); |
||
| 19 | |||
| 20 | foreach ($modules as $module) { |
||
| 21 | if (method_exists(App::$cur->$module, 'siteSearch')) { |
||
| 22 | $map[$module] = App::$cur->$module->siteSearch($_GET['search']); |
||
| 23 | } |
||
| 24 | } |
||
| 25 | } |
||
| 26 | $this->view->page(['data' => ['map' => $map]]); |
||
| 27 | } |
||
| 28 | } |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.