That snippit of code requires you to setup a theme, which contains the views your going to use. Did you do that? He probably also has some means of passing $this->data to the theme, which isn't in this snippet.
If you're new to Fuel it's probably better to follow the documenation and stick to using Controller_Template.
Sorry, I posted it while at work, so I didn't modify the answer. RTj, if you are learning Fuel I suggest you to use the View and not the Theme, you can learn about it later.
To do that follow this code:
class Controller_Example extends Controller_Template { public function action_index() { // Create a pagination $pagination = \Pagination::forge('pagination', array( 'pagination_url' => \Uri::base(false) . 'blog/index/', 'total_items' => Model_Content::find()->where('published', 1)->count(), 'per_page' => 10, 'uri_segment' => 3, 'num_links' => 5, ));
// Get contents based on pagination $contents = Model_Content::find() ->where('published', 1) ->order_by('id', 'desc') ->offset($pagination->offset) ->limit($pagination->per_page) ->get();
// Set templates variables $this->template->content = View::forge('example/index', $contents); } }
To understand how to call it from browser, I suggest you to read the doc.
in your view. If you use an instance, like in the example above, you have to pass that instance to your view (disable encoding when you do), and then in your view use