I use CodeIgniter, and one of my views turned out to be quite large, so I moved part of the code to a function in the same file:
function html_stuff()
{
$posts = $this->db->query('select * from posts');
}
When I run this code, I get the following error:
Fatal error: using $ this if not in the object context in /somepath/view.php
source
share