An Example Public Controller

This is an example of a public controller which could be added to a website's "controller" path.

<?php

require_once(CONTROLLER_PATH . 'public.controller.class.php');

class ExampleController extends InvPublicController{

	public function __construct($obj_db , $obj_session , $view_template , $path_info){
		//$this->token_exempt = true; // Uncomment this if your controller needs to skip the CSRF token checks (NOT RECOMMENDED)
		$this->view_title = 'Your Title Here';
		parent::__construct($obj_db , $obj_session , $view_template , $path_info);
	}

	/**
	* This is where you would fetch the POST GET user input values ready for use elsewhere in the controller.
	*
	* Once a value has been fetched into the controller using $this->setInputValue($key)
	* It can be accessed using $this->arr_input[$key]
	*/
	protected function setInputValues(){

		// Eg:
		/*
		$this->setInputValue('myname');
		$this->setInputValue('myemail');
		*/

		// The above, now set, can later be accessed thus:
		/*
		$this->arr_input['myname'];
		$this->arr_input['myemail'];
		*/

	}


	/**
	* The controller itself
	*
	* This is where we process any user input, and generate the output
	*/
	protected function doController() {

		// eg:
		/*
		$this->welcome_message = false;
		if($this->arr_input[myname']){
			$this->welcome_message = true;
		}
		*/
	}	

	/**
	* You can add whatever special methods you need into to complete this controller here.
	*
	*/
	
}

?>

Contact Us

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