public static function includeMedia($path, $controller, $view, $class) {
		// generating a list of extensions
		$valid_extensions = ['js', 'css'];
		if (Application::get('dep.submodule.numbers.frontend.media.scss')) {
			$valid_extensions[] = 'scss';
		}
		// we need to fix path for submodules
		$path_fixed = str_replace('/', '_', $path);
		$path_js = str_replace('_' . $controller, '', $class) . '_';
		if (substr($path, 0, 8) == 'numbers/') {
			$path = '../libraries/vendor/' . $path;
		}
		//$path = Application::get(['application', 'path_full']) . $path;
		// build an iterator
		$iterator = new FilesystemIterator($path);
		$filter = new RegexIterator($iterator, '/' . $controller . '(.' . $view . ')?.(' . implode('|', $valid_extensions) . ')$/');
		$file_list = [];
		// iterating
		foreach($filter as $v) {
			$temp = $v->getFilename();
			$extension = pathinfo($temp, PATHINFO_EXTENSION);
			// we need to sort in a way that view files are included second
			if ($controller . '.' . $extension == $temp) {
				$sort = 1000;
			} else {
				$sort = 2000;
			}
			$new = '/numbers/media_generated/application_' . $path_js . $temp;
			if ($extension == 'js') {
				self::add_js($new, $sort);
			} else if ($extension == 'css') {
				self::add_css($new, $sort);
			} else if ($extension == 'scss') {
				$new.= '.css';
				self::add_css($new, $sort);
			}
			// adding media files to application for further reporting
			Application::set(['application', 'loaded_classes', $class, 'media'], ['file' => $temp, 'full' => $new], ['append' => true]);
		}
	}