Skip to content

Commit

Permalink
views
Browse files Browse the repository at this point in the history
  • Loading branch information
parf committed Jun 8, 2018
1 parent 075eaa3 commit 4bfb828
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 0 deletions.
9 changes: 9 additions & 0 deletions project/app1/view/Index.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{%% G.title "Sample Site Main"}
<h1>View SYSTEM !!</h1>
<h2>Test</h2>
<pre>
Known node {=x}.
Allow undefined {=?undefined}.
Raw: {=@x}.
X={=x}
</pre>
56 changes: 56 additions & 0 deletions project/app1/view/Layout.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
/**
G.title << required = string or array
G.meta << G.meta.$name => $content
G.css << G.css.$name => filename
G.js << G.js.$name => filename
G.head << G.head.$name = HTML << add ANY html to HEAD
G.body-top << G.body-top.$name = HTML << add ANY html to the top of the body
G.body-bottom << G.body-bottom.$name = HTML << add ANY html to the bottom of the body
Examples:
G.css.my-css = "/css/my-css"
G.meta.description = "my-description"
G.meta.viewport = "width=device-width"
**/

$P['G.js.jquery'] = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js";
$P["G.css.main"] = "/css/main.css";
$P['G.meta.viewport'] = "width=device-width";

?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>{=G.title | not_empty}</title>
{?G.head}{#G.head}{=@.}{/* NAME => FULL meta tag */}{/#}{/?}
{#G.meta}<meta name="{=#}" content="{=.}">{/#}
{#G.css}{?.}<link href="{=. | \WebVersion::url}" rel="stylesheet">{/?} {/#}
{#G.js}{?. | \WebVersion::url}<script src="{=?}"></script>{/?} {/#} {/* local versioned & remote javascripts */}
</head>
<body>
{=@?G.body-top}
{=:header}
{=@MAIN}
{=:footer}
{=@?G.body-top}
{%xadmin}
<style>
admin, .admin, .admin a { color: #f55 !important; }
.admin-item-info { border: 1px solid #f55; display: inline-block; }
</style>
{=/inc/Debug:footer}
{/}
</body>
</html>

{:block header}
<div id=header>HEADER</div>
<div id=body>
{/:}

{:block footer}
</div>
<div id=footer>Footer</div>
{/:}
5 changes: 5 additions & 0 deletions project/src/app1/action/Root.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ function iGenerator() {
}

function index() {
$this["x"] = "xxx";
echo "INDEX";
\hb\e("{red}hb\\e TEXT{/}");
\hb\err("{red}hb\\err TEXT{/}");
echo "End of Action<hr>";
}

}
1 change: 1 addition & 0 deletions project/src/app1/view
File renamed without changes.
1 change: 1 addition & 0 deletions standalone-app/SampleApp/config/a2/x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xxy: "app.a2.x.xxy node"
2 changes: 2 additions & 0 deletions standalone-app/SampleApp/src/SampleApp/action/Root.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ function index() {
$this["x"] = "xxx";
\hb\e("{red}hb\\e TEXT{/}");
\hb\err("{red}hb\\err TEXT{/}");
//v(C("app.a2.x.xxy"));
//v(i('config')->config());
}

}
3 changes: 3 additions & 0 deletions standalone-app/SampleApp/tests/t.stest
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

$d = \hb\DB("emp");
'Instance(hb\\db\\adapter\\Mysql)';

iprofiler()::$enabled;
0;

0 comments on commit 4bfb828

Please sign in to comment.