/** * Callback function for rendering quotes. * * @param string $matches PCRE matches. * @return string The quote content. */ protected function replaceCallback($matches) { $this->view->setControllerContext($this->controllerContext); $this->view->setTemplatePathAndFilename(File::replaceSiteRelPath($this->settings['template'])); $tmp = $this->postRepository->findByUid((int) $matches[1]); if (!empty($tmp)) { $this->view->assign('post', $tmp); } $this->view->assign('quote', trim($matches[2])); return $this->view->render(); }