09-25-2010, 04:17 PM
[eluser]Avril[/eluser]
Hello,
I have class called Blog_model that gets all my blog posts from the database.
This works like a charm, so here's my code:
Now I have made a second function that will split the Title for design purposes.
So, how do I get the array from the getBlogPosts function into my splitTitle function?
Something like this?:
Hello,
I have class called Blog_model that gets all my blog posts from the database.
This works like a charm, so here's my code:
Code:
<?php
class Blog_model extends Model{
function getBlogPosts(){
$this->db->select('title, author, content, date_posted');
$this->db->from('lm_blog_posts');
$this->db->where('type', 3);
$q = $this->db->get();
if( $q->num_rows() >= 1){
foreach( $q->result() as $row ){
$data[] = $row;
}
return $data;
}
}
function splitTitle(){
}
}
Now I have made a second function that will split the Title for design purposes.
So, how do I get the array from the getBlogPosts function into my splitTitle function?
Something like this?:
Code:
$this->getBlogPosts['title']