In my view I have this part:
$rep = array(' ', '@', ',');
$naslov = strtolower(str_replace($rep, '_', $vest['naslov']));
$naslov = str_replace('"', '', $naslov );
$text = html_entity_decode(word_limiter(($vest['opis']),63));
$text = preg_replace("/<img[^>]+>/i", "", $text);
$text = str_replace('\n', '<br>', $text);
And this is repeating 3 times for 3 different types of articles (this is needed, no way around this). My question here is: Is it good to call custom library inside view or bad? Is there some other way beside this and writing function in view controller (I also need this function in few other view files)?