main
Robert 5 months ago
parent 9bdb91a23e
commit e57de027e1
  1. 3
      protected/src/composer.json
  2. 32
      protected/src/configs/on_footer_banner.php
  3. 15
      protected/src/configs/on_html_purifier.php
  4. 15
      protected/src/configs/on_liquid.php
  5. 6
      protected/src/configs/on_twig.php
  6. 3
      protected/src/controllers/app/home_ctrl.php
  7. 20
      protected/src/services/on_html_filter.php
  8. 8
      protected/src/services/on_liquid.php
  9. 8
      protected/src/services/on_twig.php
  10. 8
      protected/src/views/default/app/home_index.php

@ -1,6 +1,7 @@
{ {
"require": { "require": {
"twig/twig": "^3.0", "twig/twig": "^3.0",
"liquid/liquid": "^1.4" "liquid/liquid": "^1.4",
"ezyang/htmlpurifier": "^4.18"
} }
} }

@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
/**
* @author Robert Strutts <Bob_586@Yahoo.com>
* @copyright (c) 2025, Robert Strutts
* @license MIT
*/
?>
<footer style="
background-color: #333;
color: white;
text-align: center;
padding: 20px 0;
position: fixed;
bottom: 0;
width: 100%;
font-family: Arial, sans-serif;
border-top: 2px solid #444;
">
<div style="max-width: 800px; margin: 0 auto;">
<p style="margin: 0; padding: 0;">&copy; <?= date('Y') ?> Your Company Name. All rights reserved.</p>
<p style="margin: 10px 0 0 0; padding: 0; font-size: 0.8em;">
<a href="/privacy" style="color: #4da6ff; text-decoration: none;">Privacy Policy</a> |
<a href="/terms" style="color: #4da6ff; text-decoration: none;">Terms of Service</a> |
<a href="/contact" style="color: #4da6ff; text-decoration: none;">Contact Us</a>
</p>
</div>
</footer>

@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
/**
* @author Robert Strutts <Bob_586@Yahoo.com>
* @copyright (c) 2025, Robert Strutts
* @license MIT
*/
use CodeHydrater\bootstrap\configure as Config;
Config::set('html_purifier', [
"enable_file_caching" => false
]);

@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
/**
* @author Robert Strutts <Bob_586@Yahoo.com>
* @copyright (c) 2025, Robert Strutts
* @license MIT
*/
use CodeHydrater\bootstrap\configure as Config;
Config::set('liquid', [
"enable_file_caching" => false
]);

@ -8,4 +8,8 @@ declare(strict_types=1);
* @license MIT * @license MIT
*/ */
echo "Hello, Loaded Test Config file..."; use CodeHydrater\bootstrap\configure as Config;
Config::set('twig', [
"enable_file_caching" => false
]);

@ -10,7 +10,6 @@ declare(strict_types = 1);
namespace Project\controllers\app; namespace Project\controllers\app;
use CodeHydrater\enums\view_type as ViewType; use CodeHydrater\enums\view_type as ViewType;
use CodeHydrater\bootstrap\registry as Reg;
/** /**
* Description of home_ctrl * Description of home_ctrl
@ -62,7 +61,7 @@ class home_ctrl {
} }
public function demo(?string $name="Test", ?int $limit=10, ?int $page=1) { public function demo(?string $name="Test", ?int $limit=10, ?int $page=1) {
echo "DEMO Name: ". $name; echo "DEMO Name: ". \CodeHydrater\bootstrap\safer_io::p($name);
echo "LIMIT = ". $limit; echo "LIMIT = ". $limit;
echo "PAGE = ". $page; echo "PAGE = ". $page;
} }

@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
/**
* @author Robert Strutts <Bob_586@Yahoo.com>
* @copyright (c) 2025, Robert Strutts
* @license MIT
*/
use CodeHydrater\bootstrap\registry as Reg;
use CodeHydrater\bootstrap\configure as Config;
Reg::get('di')->register('html_filter', function() {
$use_file_cache = Config::get('html_purifier', "enable_file_caching") ?? false;
return new \CodeHydrater\services\html_filter(
$use_file_cache
);
});

@ -8,8 +8,12 @@ declare(strict_types=1);
* @license MIT * @license MIT
*/ */
use CodeHydrater\bootstrap\registry as Reg; use CodeHydrater\bootstrap\registry as Reg;
use CodeHydrater\bootstrap\configure as Config;
Reg::get('di')->register('liquid', function() { Reg::get('di')->register('liquid', function() {
return new \CodeHydrater\services\liquid_templates();
$use_file_cache = Config::get('liquid', "enable_file_caching") ?? false;
return new \CodeHydrater\services\liquid_templates($use_file_cache);
}); });

@ -8,8 +8,12 @@ declare(strict_types=1);
* @license MIT * @license MIT
*/ */
use CodeHydrater\bootstrap\registry as Reg; use CodeHydrater\bootstrap\registry as Reg;
use CodeHydrater\bootstrap\configure as Config;
Reg::get('di')->register('twig', function() { Reg::get('di')->register('twig', function() {
return \CodeHydrater\services\twig::init();
$use_file_cache = Config::get('twig', "enable_file_caching") ?? false;
return \CodeHydrater\services\twig::init($use_file_cache);
}); });

@ -1,11 +1,17 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
$route_name_demo = "app/home"; $route_name_demo = "app/home";
$method_name_demo = "name_demo"; $method_name_demo = "name_demo";
$route_liquid = "app/home";
$method_liquid = "liquid";
?> ?>
<h2>Welcome...to your M0ck Ups</h2> <h2>Welcome...to your M0ck Ups</h2>
<a href="<?= \CodeHydrater\misc::get_url($route_name_demo, $method_name_demo) ?>">View Name Demo</a> <br/><br/> <a href="<?= \CodeHydrater\misc::get_url($route_name_demo, $method_name_demo) ?>">View Twig Demo</a> <br/><br/>
<a href="<?= \CodeHydrater\misc::get_url($route_liquid, $method_liquid) ?>">View Liquid Demo</a> <br/><br/>
Loading…
Cancel
Save