/** * @param string $view * @param array $data * @return string */ public function partial($view, array $data = []) { $data['theme'] = $this; $view = \Bloge\removeExtension($view); $path = "{$this->path}/{$view}.php"; if (!file_exists($path)) { throw new NotFoundException($view); } return \Bloge\render($path, array_merge($this->data, $data)); }
/** * @dataProvider removeExtensions */ public function testRemoveExtension($file, $expected) { $this->assertEquals($expected, Bloge\removeExtension($file)); }