1 | <?php |
||
25 | class PHPEngine extends AbstractEngine |
||
26 | { |
||
27 | |||
28 | const PHP_EXTENSION = '.php'; |
||
29 | |||
30 | /** |
||
31 | * Check whether the Findable can handle an individual criterion. |
||
32 | * |
||
33 | * @since 0.1.0 |
||
34 | * |
||
35 | * @param mixed $criterion Criterion to check. |
||
36 | * |
||
37 | * @return bool Whether the Findable can handle the criterion. |
||
38 | */ |
||
39 | 17 | public function canHandle($criterion) |
|
40 | { |
||
41 | 17 | return $this->hasExtension($criterion, static::PHP_EXTENSION) |
|
42 | 17 | && is_readable($criterion); |
|
43 | } |
||
44 | |||
45 | /** |
||
46 | * Render a given URI. |
||
47 | * |
||
48 | * @since 0.1.0 |
||
49 | * |
||
50 | * @param string $uri URI to render. |
||
51 | * @param array $context Context in which to render. |
||
52 | * |
||
53 | * @return string Rendered HTML. |
||
54 | * @throws FailedToLoadViewException If the View URI is not accessible or readable. |
||
55 | * @throws FailedToLoadViewException If the View URI could not be loaded. |
||
56 | */ |
||
57 | 17 | public function render($uri, array $context = []) |
|
97 | } |
||
98 |