main
Robert 5 months ago
parent 321bf74487
commit bc261ebc2a
  1. 31
      protected/src/configs/on_CodeHydrater.php
  2. 9
      protected/src/configs/on_view_mode.php
  3. 50
      protected/src/controllers/app/home_ctrl.php
  4. 17
      protected/src/routes/routes.php
  5. 35
      protected/src/templates/main.php
  6. 18
      protected/src/views/default/app/footer.php
  7. 14
      protected/src/views/default/app/header.php
  8. 11
      protected/src/views/default/app/home_index.php
  9. 2
      public/index.php

@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
use CodeHydrater\bootstrap\configure as Config;
/**
* @todo REMOVE or CHANGE [set_local_site_domains] to your
* PRIVATE or non-public accessible site domain name.
*
* Make sure the web-server only servers it on a
* loop-back or non-routable IP address range,
* otherwise people will be able to see lots of
* private DEBUG info. Also, make sure your HOST file has an
* entry to your web server's IP IG: 127.0.0.1 project.home.local
*
* When in Doubt, just make live false, below here!!!
*/
// \CodeHydrater\bootstrap\site_helper::set_local_site_domains('project.home.local');
\CodeHydrater\bootstrap\site_helper::set_allowed_Private_IPs(['192.168.10.2']);
// \CodeHydrater\bootstrap\site_helper::set_allowed_Public_IPs('12.x.x.x');
$is_live = \CodeHydrater\bootstrap\site_helper::remote_not_allowed_force_live();
Config::set('CodeHydrater', array(
'site_name' => 'Testing Project',
'short_url' => true,
'default_project' => 'home',
'check_HTML_tags' => true,
'live' => $is_live,
));

@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
use CodeHydrater\bootstrap\configure as Config;
Config::set('view_mode', array(
'default_paths' => array('json', 'common', 'flexbox', 'default')
));

@ -0,0 +1,50 @@
<?php
declare(strict_types = 1);
/**
* @author Robert Strutts <Bob_586@Yahoo.com>
* @copyright (c) 2025, Robert Strutts
* @license MIT
*/
namespace Project\controllers\app;
/**
* Description of home_ctrl
*
* @author Robert Strutts <Bob_586@Yahoo.com>
*/
class home_ctrl {
public function index() {
$html = new \CodeHydrater\html_document();
$html->set_author("Robert Strutts, plus ME!");
$view = new \CodeHydrater\view();
$view->set('html', $html);
$view->set_template('main');
$view->include("app/header");
$view->include("app/footer");
$view->render($this, "app/home_index");
}
public function name_demo() {
echo "OLD DEMO Page...!";
}
/**
* from Routes
*
*/
public function test(int $id) {
echo "The ID for Test Example is # $id";
}
public function demo(?string $name="Test", ?int $limit=10, ?int $page=1) {
echo "DEMO Name: ". $name;
echo "LIMIT = ". $limit;
echo "PAGE = ". $page;
}
public function error() { \CodeHydrater\bootstrap\broken_error(); } // Needed: To show Live Page for Broken Pages must only be in the default Project HomePage
}

@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace Project\routes;
use \CodeHydrater\router as Router;
class routes {
public static function get() {
// ::i is a int() shortcut, ::s is a string
Router::get('example/{id::i}', 'Project\controllers\app\home_ctrl@test');
Router::route("demo/{name::s}/{limit::i}?/{page::i}?", "Project\controllers\app\home_ctrl@demo");
}
}

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<base href="<?= PROJECT_ASSETS_BASE_REF; ?>/">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="<?= $html->get_keywords(); ?>">
<meta name="description" content="<?= $html->get_description(); ?>">
<meta name="author" content="<?= $html->get_author(); ?>">
<meta name="language" content="english">
<meta name="robots" content="<?= $html->get_robots(); ?>">
<meta name="copyright" content="2014-<?= date('Y'); ?>">
<title><?= $html->get_title(); ?></title>
<link rel="apple-touch-icon" sizes="180x180" href="<?= PROJECT_ASSETS_BASE_REF ?>/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="<?= PROJECT_ASSETS_BASE_REF ?>/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="<?= PROJECT_ASSETS_BASE_REF ?>/favicon/favicon-16x16.png">
<link rel="icon" type="image/ico" href="<?= PROJECT_ASSETS_BASE_REF ?>/favicon/favicon.ico">
<link rel="manifest" href="<?= PROJECT_ASSETS_BASE_REF ?>/favicon/site.webmanifest">
<?= $html->get_head(); ?>
<?= $html->get_main_styles(); ?>
<?= $html->get_styles(); ?>
<?= $html->get_main_scripts(); ?>
</head>
<body <?= $html->get_body(); ?>>
<?= $local->page_output ?>
<?= $html->get_footer(); ?>
<?= $html->get_scripts(); ?>
<?= $html->get_js_onready(); ?>
</body>
</html>

@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
$AJAX_FOLDER = PROJECT_ASSETS_BASE_REF. "/ajax/";
const JS_CDN_FILES = [
"https://cdn.metroui.org.ua/v4/js/metro.min.js" => [],
];
//const JS_TSR = [ "js/trouble_shooting_routes.js" =>[] ];
//const JS_FILES = [
// "js/routes.js" => [],
//];
$html->set_assets_from_array(JS_CDN_FILES, 'main_js', 'cdn');
//$html->set_assets_from_array(JS_TSR, 'js', 'assets');
//$html->set_assets_from_array(JS_FILES, 'js', 'project');

@ -0,0 +1,14 @@
<?php
declare(strict_types=1);
const CSS_CDN_FILES = [
'https://cdn.metroui.org.ua/v4/css/metro-all.min.css' => ['media'=>'all']
];
const CSS_FILES = [
'css/main.css' => [],
];
$html->set_assets_from_array(CSS_CDN_FILES, 'main_css', 'cdn');
//$html->set_assets_from_array(CSS_FILES, 'css');

@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
$route_name_demo = "app/home";
$method_name_demo = "name_demo";
?>
<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/>

@ -15,6 +15,6 @@ const CodeHydrater_FRAMEWORK = BaseDir . "/protected/FWCodeHydrater/src/";
$testing = false; $testing = false;
require_once CodeHydrater_FRAMEWORK . 'bootstrap/site_helper.php'; require_once CodeHydrater_FRAMEWORK . 'bootstrap/site_helper.php';
CodeHydrater\bootstrap\site_helper::init(BaseDir, $_SERVER['REQUEST_URI'], $_SERVER['REQUEST_METHOD'], $testing); CodeHydrater\bootstrap\site_helper::init(CodeHydrater_PROJECT, $_SERVER['REQUEST_URI'], $_SERVER['REQUEST_METHOD'], $testing);
require_once CodeHydrater_FRAMEWORK . "bootstrap/main.php"; require_once CodeHydrater_FRAMEWORK . "bootstrap/main.php";
Loading…
Cancel
Save