Creating an extension's Public Controller - RelationalExtend/RelationalExtend GitHub Wiki

##fuel/extensions/sample/classes/controller/sample.php

<?php
/**
 * Main Public Controller for the Sample Module
 *
 * @author     Ahmed Maawy and Nick Hargreaves
 * @copyright  2011 - 2012 Ahmed Maawy
 */

namespace sample;
 
class Controller_Sample extends \Controller_Public {
	public function action_index($page_slug)
	{
		return $this->render_layout("main_layout_file", array("page_slug" => $page_slug));
	}
}

The sample controller above demonstrates how to make use of the public controller to interface with the installed default activated theme.

The example above will execute the Lex Parser for the main_layout_file layout item. The page_slug will be passed as parameters to the plugins and will be executed with other extensions in their Execute plugin extensions.

##render_layout

protected function render_layout($layout_slug, $parameters = array())