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'];
	}
	
}

?>

Theme template

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.

If you are using a custom theme for your website

[path_to_site]/theme/[theme_name]/[controller_name].html

If you are using a library theme for your website

[path_to_site]/theme/custom/[controller_name].html

Example template

<h1>Example Template</h1>
<p><?php echo htmlspecialchars($this->message) ?></p>

More information on the structure of dotAdmin controllers here

Another example dotAdmin public controller here

Contact Us

Address: 22a Fishergate York, YO10 4AB · Tel: 01904 636677 · Email: info@dotadmin.com