49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
|
|
if (!isset($vueViewName)) {
|
|
die("vueViewName is not set");
|
|
}
|
|
|
|
if (!isset($mfLayoutPackage)) {
|
|
die("mfLayoutPackage is not set");
|
|
}
|
|
|
|
$additionalCSS = $additionalCSS ?? [];
|
|
$additionalJS = $additionalJS ?? [];
|
|
|
|
$additionalJS = [
|
|
...$additionalJS,
|
|
"bundler.php",
|
|
"js/pages/" . $vueViewName . "/" . $vueViewName . ".js",
|
|
];
|
|
|
|
$additionalCSS = [
|
|
...$additionalCSS,
|
|
'plugins/daterangepicker/daterangepicker.css',
|
|
'plugins/vue/tt-components/css/tt-table.css',
|
|
'plugins/vue/tt-components/css/tt-loader.css',
|
|
];
|
|
|
|
/**
|
|
* Convert PascalCase to snake_case (e.g. PascalCase to pascal-case)
|
|
* @param $str string PascalCase string
|
|
* @return string snake-case string
|
|
*/
|
|
function pascalToSnakeCase(string $str): string {
|
|
$snakeCase = preg_replace('/(?<!^)([A-Z])/', '-$1', $str);
|
|
return strtolower($snakeCase);
|
|
}
|
|
|
|
$vueTagName = pascalToSnakeCase($vueViewName);
|
|
|
|
include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/vueHeader.php"); ?>
|
|
|
|
|
|
<div id="app">
|
|
<<?php echo $vueTagName; ?>></<?php echo $vueTagName; ?>>
|
|
</div>
|
|
<script>
|
|
const view = new Vue({el: '#app'});
|
|
</script>
|
|
|
|
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|