Skip to content

Commit

Permalink
Merge pull request #5 from bim-g/layout
Browse files Browse the repository at this point in the history
[ENH] refactor module view with new aproch
  • Loading branch information
bim-g committed Feb 2, 2023
2 parents 72a49ee + fb4d5e1 commit f8b1230
Show file tree
Hide file tree
Showing 22 changed files with 457 additions and 270 deletions.
5 changes: 0 additions & 5 deletions .htaccess

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/php.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

14 changes: 0 additions & 14 deletions .idea/wepesi-view.iml

This file was deleted.

5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "apache-2.0",
"autoload": {
"psr-4": {
"Wepesi\\": "src/"
"Wepesi\\App\\": "src/"
}
},
"authors": [
Expand All @@ -17,8 +17,5 @@
"minimum-stability": "dev",
"require": {
"php": ">=7.4"
},
"require-dev": {
"wepesi/routing": "dev-master"
}
}
57 changes: 3 additions & 54 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 0 additions & 33 deletions demo/index.php

This file was deleted.

34 changes: 0 additions & 34 deletions demo/users.php

This file was deleted.

4 changes: 4 additions & 0 deletions example/example_one.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

$view->assign("title","My Art");
$view->render("/art.php");
6 changes: 6 additions & 0 deletions example/example_two.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
$view->assign("title","W3css Courses");

$view->setLayout("/layout");
$view->render("/home");
// $view->render("/contact.php");
12 changes: 12 additions & 0 deletions example/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
include __DIR__."/../vendor/autoload.php";
use Wepesi\App\View;

$rootDir = __DIR__."/view";
$view = new View($rootDir);

// to work without layout
// include_once __DIR__."/example_one.php";

// example with layout
include_once __DIR__."/example_two.php";
68 changes: 68 additions & 0 deletions example/view/art.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html>
<head>
<title><?=$title??"Wepesi view title"?></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" type="text/css">
<style>
body {font-family: "Raleway", Arial, sans-serif}
.w3-row img {margin-bottom: -8px}
</style>
</head>
<body>

<!-- !PAGE CONTENT! -->
<div class="w3-content" style="max-width:1500px">

<!-- Header -->
<header class="w3-container w3-xlarge w3-padding-24">
<a href="#" class="w3-left w3-button w3-white">MY ART</a>
<a href="#about" class="w3-right w3-button w3-white">About</a>
</header>

<!-- Photo Grid -->
<div class="w3-row">
<div class="w3-half">
<img src="https://www.w3schools.com/w3images/streetart.jpg" style="width:100%">
<img src="https://www.w3schools.com/w3images/streetart2.jpg" style="width:100%">
<img src="https://www.w3schools.com/w3images/streetart5.jpg" style="width:100%">
</div>

<div class="w3-half">
<img src="https://www.w3schools.com/w3images/streetart3.jpg" style="width:100%">
<img src="https://www.w3schools.com/w3images/streetart4.jpg" style="width:100%">
</div>
</div>

<!-- End Page Content -->
</div>

<!-- Footer / About Section -->
<footer class="w3-light-grey w3-padding-64 w3-center" id="about">
<h2>About</h2>
<img src="https://www.w3schools.com/w3images/boy.jpg" class="w3-image w3-padding-32" width="300" height="300">
<form style="margin:auto;width:60%" action="/action_page.php" target="_blank">
<p>Just me, myself and I, exploring the universe of unknownment. I have a heart of love and an interest of lorem ipsum and mauris neque quam blog. I want to share my world with you. Praesent tincidunt sed tellus ut rutrum. Sed vitae justo condimentum, porta lectus vitae, ultricies congue gravida diam non fringilla. Praesent tincidunt sed tellus ut rutrum. Sed vitae justo condimentum, porta lectus vitae, ultricies congue gravida diam non fringilla.</p>
<p class="w3-large w3-text-pink">Do not hesitate to contact me!</p>
<div class="w3-section">
<label><b>Name</b></label>
<input class="w3-input w3-border" type="text" required name="Name">
</div>
<div class="w3-section">
<label><b>Email</b></label>
<input class="w3-input w3-border" type="text" required name="Email">
</div>
<div class="w3-section">
<label><b>Message</b></label>
<input class="w3-input w3-border" required name="Message">
</div>
<button type="submit" class="w3-button w3-block w3-dark-grey">Send</button>
</form>
<br>
<p>Powered by <a href="https://www.w3schools.com/w3css/default.asp" target="_blank" class="w3-hover-text-green">w3.css</a></p>
</footer>

</body>
</html>
36 changes: 36 additions & 0 deletions example/view/contact.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

<!-- Contact Container -->
<div class="w3-container w3-padding-64 w3-theme-l5" id="contact">
<div class="w3-row">
<div class="w3-col m5">
<div class="w3-padding-16"><span class="w3-xlarge w3-border-teal w3-bottombar">Contact Us</span></div>
<h3>Address</h3>
<p>Swing by for a cup of coffee, or whatever.</p>
<p><i class="fa fa-map-marker w3-text-teal w3-xlarge"></i>  Chicago, US</p>
<p><i class="fa fa-phone w3-text-teal w3-xlarge"></i>  +00 1515151515</p>
<p><i class="fa fa-envelope-o w3-text-teal w3-xlarge"></i>  [email protected]</p>
</div>
<div class="w3-col m7">
<form class="w3-container w3-card-4 w3-padding-16 w3-white" action="/action_page.php" target="_blank">
<div class="w3-section">
<label>Name</label>
<input class="w3-input" type="text" name="Name" required>
</div>
<div class="w3-section">
<label>Email</label>
<input class="w3-input" type="text" name="Email" required>
</div>
<div class="w3-section">
<label>Message</label>
<input class="w3-input" type="text" name="Message" required>
</div>
<input class="w3-check" type="checkbox" checked name="Like">
<label>I Like it!</label>
<button type="submit" class="w3-button w3-right w3-theme">Send</button>
</form>
</div>
</div>
</div>
<!-- Image of location/map -->
<img src="https://www.w3schools.com/w3images/map.jpg" class="w3-image w3-greyscale-min" style="width:100%;">
Loading

0 comments on commit f8b1230

Please sign in to comment.