# css-javascript-toolbox/11.4/controllers/settings.php

CSS &amp; JavaScript Toolbox, version 11.4. 69 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/11.4/code/controllers/settings.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/11.4/raw/controllers/settings.php
- Modified: 2021-07-05T15:27:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/css-javascript-toolbox/11.4/code/controllers/settings.php#L10-L20`.

```php
<?php
/**
* 
*/

// Disallow direct access.
defined('ABSPATH') or die("Access denied");

// import dependencies.
cssJSToolbox::import('framework:mvc:controller-ajax.inc.php');

/**
* 
*/
class CJTSettingsController extends CJTAjaxController {
	
	/**
	* put your comment there...
	* 
	* @var mixed
	*/
	protected $controllerInfo = array('model' => 'settings');
	
	/**
	* put your comment there...
	* 
	*/
	public function __construct() {
		parent::__construct();
		// Actions.
		$this->registryAction('manageForm');
		$this->registryAction('save');
		$this->registryAction('restoreDefault');
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function manageFormAction() {
		// Create settings view.
		$view = self::getView('settings/manager');
		// Push settings into the view.
		$view->settings = $this->model;
		// Output settings view.
		$this->httpContentType = 'text/html';
		$this->response = $view->getTemplate('settings');
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function restoreDefaultAction() {
		
	}
	
	/**
	* put your comment there...
	* 
	*/
	public function saveAction() {
		// Get settings page parameters.
		$settings = filter_input(INPUT_POST, 'settings', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY);
		$this->model->save($settings);
		$this->response = true;
	}
	
} // End class.
```
