To create a custom public controller for your website, just add a new controller to your website's controller folder:
[path_to_site]/controller/[controller_name].controller.class.php
Your controller will extend InvPublicController, and the basic structure will be:
<?php
class ExampleController extends InvPublicController
{
public function __construct($obj_db , $obj_session , $view_template , $path_info){
parent::__construct($obj_db , $obj_session , $view_template , $path_info);
$this->view_title = 'Example';
}
protected function setInputValues()
{
// Set any GET / POST inputs required by your controller, for example
$this->setInputValue('example1');
$this->setInputValue('example2');
}
public function doController()
{
// Process user input, and generate output, for example...
$this->message = 'Received: ' . $this->arr_input['example1'] . ' and ' . $this->arr_input['example2'];
}
}
?>
You should also add a theme template for this controller in your current theme folder. If you're using a library theme theme, you can create a 'custom' folder within themes to contain your custom templates.
[path_to_site]/theme/[theme_name]/[controller_name].html
[path_to_site]/theme/custom/[controller_name].html
<h1>Example Template</h1> <p><?php echo htmlspecialchars($this->message) ?></p>
More information on the structure of dotAdmin controllers here