[eluser]WanWizard[/eluser]
You will have to make a design decision:
You can add title splitting logic to getBlogPosts().
You can create splitTitle() so that it expects a data array, and then use this in your controller:
Code:
$data = $this->Blog_model->splitTitle( $this->Blog_model->getBlogPosts() );
or create splitTitle() so that it expects a string 'title', and then use this in your controller:
Code:
$data = $this->Blog_model->getBlogPosts();
foreach ( $data as $key => $value )
{
$data[$key]['title'] = $this->Blog_model->splitTitle( $value['title'] );
}
You can also code splitTitle() to be an enhancement to getBlogPosts(). Have splitTitle() call getBlogPosts(), loop over the result like above, and return the array with converted titles.
Plenty of options to choose from... I would go for the last option. Keep it clean, and all data processing in the model.