namespace = array_key_exists("id", $_GET) ? $_GET["id"] : null; if ($this->namespace) { $this->dir = "snippets/HTMLCodeDemoElement/{$this->namespace}/"; if (is_dir(VV::root($this->dir))) { // Strip "." and ".." $this->files = array_filter(scandir(VV::root($this->dir), SCANDIR_SORT_DESCENDING), function (string $item) { return substr($item, 0, 1) !== "."; }); $this->valid = true; } } } public static function name(string $file): string { return substr($file, 0, strlen($file) - 4); } public static function language(string $file): string { return explode(".", $file, 3)[1]; } public static function icon(string $file): string { $file = self::language($file); $path = "public/assets/media/icons/languages/{$file}.svg"; // Return language icon if exists in icons dir else default to text return is_file(VV::root($path)) ? VV::embed($path) : VV::embed("public/assets/media/icons/languages/txt.svg"); } public function file_path(string $file): string { return $this->dir . $file; } } ?> valid): ?> files as $file): ?> = $HTMLCodeDemoElement::icon($file) ?> = substr($file, 0, strlen($file) - 4) ?> files as $file): ?> = VV::include($HTMLCodeDemoElement->file_path($file)) ?> Not Found 404
= substr($file, 0, strlen($file) - 4) ?>
Not Found
404