diff --git a/protected/src/configs/on_footer_banner.php b/protected/src/configs/on_footer_banner.php index 193fc43..12125c0 100644 --- a/protected/src/configs/on_footer_banner.php +++ b/protected/src/configs/on_footer_banner.php @@ -7,10 +7,10 @@ declare(strict_types=1); * @copyright (c) 2025, Robert Strutts * @license MIT */ +namespace Project; -?> - - \ No newline at end of file + '; +} \ No newline at end of file diff --git a/protected/src/controllers/app/home_ctrl.php b/protected/src/controllers/app/home_ctrl.php index 16bc419..ce3b142 100644 --- a/protected/src/controllers/app/home_ctrl.php +++ b/protected/src/controllers/app/home_ctrl.php @@ -16,9 +16,16 @@ use CodeHydrater\enums\view_type as ViewType; * /app/home/name_demo */ class home_ctrl { - + private $footer; + public function __construct() { + // FROM on_footer_banner.php in the configs folder... + $this->footer = \Project\get_footer(); + } + + public function index() { $html = new \CodeHydrater\html_document(); + $html->set_footer($this->footer); $html->set_author("Robert Strutts, plus ME!"); $view = new \CodeHydrater\view(); @@ -30,12 +37,16 @@ class home_ctrl { } public function name_demo() { + echo $this->footer; + $view = new \CodeHydrater\view(); $view->set('twig_data', ['name' => "John Doe"]); $view->render($this, "app/test", ViewType::TWIG); } public function liquid() { + echo $this->footer; + $view = new \CodeHydrater\view(); $view->set('template_assigns', [ 'name' => "James Smith", diff --git a/protected/src/controllers/app/rss_ctrl.php b/protected/src/controllers/app/rss_ctrl.php new file mode 100644 index 0000000..60d1048 --- /dev/null +++ b/protected/src/controllers/app/rss_ctrl.php @@ -0,0 +1,47 @@ + + * @copyright (c) 2025, Robert Strutts + * @license MIT + */ +namespace Project\controllers\app; + +class rss_ctrl { + + public function feed() { + $root = [ + "feed_link" => "https://example.com/app/rss/feed", + "title" => "Example News", + "description" => "Cool New Stuff...", + "site_link" => "https://example.com", + "lang" => "en-us", + "pub_date" => "Tue, 29 Jul 2025 22:08:18 +0000", // DATE_RSS format + "last_build_date" => date(DATE_RSS), + ]; +// Should be populating items from a Database... + $items = [ + [ + 'title' => 'First Article', + 'link' => 'http://example.com/article1', + 'description' => 'This is the description of the first article.', + 'pubDate' => date(DATE_RSS, strtotime('-2 days')), + 'guid' => 'http://example.com/article1', + 'author' => 'author@example.com (John Doe)' + ], + [ + 'title' => 'Second Article', + 'link' => 'http://example.com/article2', + 'description' => 'This is the description of the second article.', + 'pubDate' => date(DATE_RSS, strtotime('-1 day')), + 'guid' => 'http://example.com/article2', + 'author' => 'author@example.com (Jane Smith)' + ] + ]; + $rss = \CodeHydrater\rss_feed::generate_rss_feed($root, $items); + \CodeHydrater\rss_feed::output_rss($rss); +// \CodeHydrater\rss_feed::save_to_xml_file($rss); // this would make feed.xml in the Public folder... + } +}