Created
July 9, 2013 20:35
-
-
Save pietvanzoen/5961047 to your computer and use it in GitHub Desktop.
Get_excerpt_stripped :: Record model method for Fuelcms modules to look for record excerpt, strip tags and set character. If no excerpt is found record content is used instead. #fuel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_excerpt_stripped($char_limit = NULL) | |
{ | |
$this->_CI->load->helper('text'); | |
$excerpt = (empty($this->excerpt)) ? $this->content : $this->excerpt; | |
// must strip tags to get accruate character count | |
$excerpt = strip_tags($excerpt); | |
if (!empty($char_limit)) | |
{ | |
$excerpt = character_limiter($excerpt, $char_limit); | |
} | |
return $excerpt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment