createExcerpt( strip_tags($pageData['content']), $this->getConfig('excerpt_length') ); } } /** * Helper function to create a excerpt of a string * * @param string $string the string to create a excerpt from * @param int $wordLimit the maximum number of words the excerpt should be long * @return string excerpt of $string */ protected function createExcerpt($string, $wordLimit) { $words = explode(' ', $string); if (count($words) > $wordLimit) { return trim(implode(' ', array_slice($words, 0, $wordLimit))) . '…'; } return $string; } }