aboutsummaryrefslogtreecommitdiffstats
path: root/include/classes/BigPipe/Resource/Javascript.php
blob: 6a9d4927c0ae1e6f08c9b0009259a2be1fb835c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
# Resource representation [javascript]       [Thomas Lange <code@nerdmind.de>] #
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
#                                                                              #
# [More information coming soon]                                               #
#                                                                              #
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
namespace BigPipe\Resource;

class Javascript extends \BigPipe\Resource {

	#===============================================================================
	# Build resource
	#===============================================================================
	public function __construct(?string $id, string $url) {
		parent::__construct($id, parent::TYPE_JAVASCRIPT, $url);
	}

	#===============================================================================
	# Render resource HTML
	#===============================================================================
	public function renderHTML(): string {
		return sprintf('<script data-id="%s" src="%s"></script>', $this->getID(), $this->getURL());
	}
}