When you ’ re working with a controller, every function or method maps to an address in your application. If you want users to view a page with the address of /page/foo , there had better be a Page controller and a foo() method inside that controller.
Once you load the model you want, you can access the methods inside that model by simply invoking the name of the model:
$this – > Page_model – > fetchHomePage();
Storing the information from the database into the $data array makes it easy to display the information in a view.
When you load a view, the name of the file (sans .php ) is the first argument, and any data you want to pass in are the second argument.
For more, visit the original documentation page.