forked from Adleraci/adlerka.top
Convert return type of dynamic pages
This commit is contained in:
parent
8a0b5e3e3a
commit
71f62f0e9c
@ -1,8 +1,7 @@
|
||||
<?php
|
||||
|
||||
function getDynamicPermission($file): int {
|
||||
include_once($file);
|
||||
return $page_parameters["minimal_permission_level"];
|
||||
return include_once($file)["parameters"]["minimal_permission_level"];
|
||||
}
|
||||
|
||||
function generateNavigation(): string
|
||||
|
@ -1,10 +1,7 @@
|
||||
<?php
|
||||
function renderDynamicPage($page_file): array
|
||||
{
|
||||
require_once $page_file;
|
||||
$page_parameters = get_parameters();
|
||||
$page_content = render();
|
||||
return ["output" => $page_content, "parameters" => $page_parameters];
|
||||
return require_once $page_file;
|
||||
}
|
||||
|
||||
function parsePageTag($input): array
|
||||
|
@ -20,3 +20,5 @@ function render(): string
|
||||
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
return render();
|
@ -19,3 +19,5 @@ function render(): string
|
||||
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
return ["output" => render(), "parameters" => $page_parameters];
|
Loading…
Reference in New Issue
Block a user