-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRobots.php
More file actions
47 lines (38 loc) · 1.05 KB
/
Copy pathRobots.php
File metadata and controls
47 lines (38 loc) · 1.05 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* This file is part of Nepttune (https://www.peldax.com)
*
* Copyright (c) 2018 Václav Pelíšek (info@peldax.com)
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <https://www.peldax.com>.
*/
declare(strict_types = 1);
namespace Nepttune\Component;
final class Robots extends \Nette\Application\UI\Control
{
private static $defaultConfig = [
'all' => [
'name' => '*',
'disallow' => null,
]
];
/** @var array */
private $config;
public function __construct(array $config)
{
parent::__construct();
$this->config = \array_merge_recursive(self::$defaultConfig, $config);
}
protected function beforeRender() : void
{
$this->template->robots = $this->robots;
}
public function render() : void
{
$this->beforeRender();
$this->template->setFile(__DIR__ . '/Robots.latte');
$this->template->render();
}
}