I'm learning the whole MVC type of programming. I have a MySQl Query inside a model like so:
<?php
class BlogModel extends BaseModel {
public static function dbBlog() {
$db = new Database(true);
$entries = $db->matrix('cms_m1_blog_ml');
$this->set('data_blog', $entries);
}
}
This script worked when I had it in the controller. the view looks like this:
<?php
foreach($data_blog as $blog)
{
echo "<ul>";
echo "<li class='name'>Name:".$blog['title'] . "</li>";
echo "<li class='content'>Content:".$blog['content'] . "</li>";
echo "</ul>";
}
How do I pass the data from the model to the controller? I ave tried all sorts of things but nothing was in the right direction. I use a custom framework build by my employee but it is based on CakePHP.