mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Better Primeview esm path
This commit is contained in:
@@ -63,9 +63,6 @@ $route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
|
||||
|
||||
$route['studentenverwaltung/(:any)/(:any)'] = 'Studentenverwaltung/index';
|
||||
|
||||
$route['public/js/components/primevue/(:any)/(:any)'] = 'public/Primevue/index/$1/$2';
|
||||
$route['public/js/components/primevue/(:any)/(:any)/(:any)'] = 'public/Primevue/index/$2/$3/$1';
|
||||
|
||||
// load routes from extensions
|
||||
$subdir = 'application/config/extensions';
|
||||
$dirlist = scandir($subdir);
|
||||
|
||||
+6
-9
@@ -2,24 +2,21 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Primevue extends FHC_Controller
|
||||
class Components extends FHC_Controller
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index($path, $file, $extrapath = null)
|
||||
public function primevue(...$args)
|
||||
{
|
||||
if ($extrapath)
|
||||
$path = $extrapath . '/' . $path;
|
||||
$target = FHCPATH . 'vendor/npm-asset/primevue/' . $path . '/' . $file;
|
||||
$path = implode('/', $args);
|
||||
$target = FHCPATH . 'vendor/npm-asset/primevue/' . $path;
|
||||
if (!file_exists($target))
|
||||
return show_404();
|
||||
|
||||
$newUrl = '../../';
|
||||
if ($extrapath)
|
||||
$newUrl .= '../';
|
||||
$newUrl = str_repeat('../', count($args));
|
||||
|
||||
$ext = substr($file, -7) == '.min.js' ? '.esm.min.js' : '.esm.js';
|
||||
$ext = substr($path, -7) == '.min.js' ? '.esm.min.js' : '.esm.js';
|
||||
|
||||
$contents = file_get_contents($target);
|
||||
|
||||
Reference in New Issue
Block a user