/** * Helper to simply replace the placeholders with there value * * @param string | Document $mixed * @param array $params * @param null | Document $document * @return string */ public function replacePlaceholders($mixed, $params = array(), $document = null) { if (is_string($mixed)) { $contentString = $mixed; } elseif ($mixed instanceof Document) { $contentString = Document_Service::render($mixed, $params, true); } if ($document instanceof Document === false) { $document = null; } //detects the placeholders $placeholderStack = $this->detectPlaceholders($contentString, $params, $document); //replaces the placeholders if any were found if (!empty($placeholderStack)) { $replacedString = $this->replacePlaceholdersFromStack($placeholderStack); return $replacedString; } else { return $contentString; } }
public function listReservationsByGuest() { $optionalParams = array('guestid' => $this->id, 'calendar' => '15-10-2015'); $useLayout = false; return Document_Service::render(Document::getById(85), $optionalParams, $useLayout); }