cleanup codeigniter code
This commit is contained in:
@@ -1,14 +1,31 @@
|
||||
<?php
|
||||
|
||||
/** Stub CI helper so the partial can be included standalone. */
|
||||
function base_url(string $path = ''): string
|
||||
{
|
||||
$path = ltrim($path, '/');
|
||||
return $path === '' ? '/' : '/' . $path;
|
||||
$root = dirname(__DIR__);
|
||||
$policyHtmlPath = '/Volumes/ExternalApps/Documents/alrahma_sunday_school_api/resources/policies/school_policy.html';
|
||||
|
||||
if (!is_file($policyHtmlPath)) {
|
||||
fwrite(STDERR, "Policy source not found: {$policyHtmlPath}\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$root = dirname(__DIR__);
|
||||
$data = include $root . '/../app_codeigniter/app/Views/policy/school_policy_partial.php';
|
||||
$html = file_get_contents($policyHtmlPath);
|
||||
if ($html === false) {
|
||||
fwrite(STDERR, "Failed to read policy source\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'title' => 'School Policy',
|
||||
'sections' => [
|
||||
[
|
||||
'subsections' => [
|
||||
[
|
||||
'body' => $html,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$outDir = $root . '/public/policy';
|
||||
if (!is_dir($outDir)) {
|
||||
|
||||
Reference in New Issue
Block a user