Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fabrice Luraine
committed
Oct 9, 2010
1 parent
17b0d64
commit 6f064c5
Showing
3 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.DS_STORE | ||
.tmproj | ||
tests/config/config.php | ||
tests/config/config.php | ||
**/cookiefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?php | ||
require_once dirname(dirname(dirname(__FILE__))).'/lib/limonade.php'; | ||
|
||
function before() | ||
{ | ||
layout('html_default_layout'); | ||
} | ||
|
||
dispatch('/', 'index'); | ||
function index() | ||
{ | ||
flash('notice', 'ON DISPLAY 2'); | ||
return html('<p>Hellooo!</p>'); | ||
} | ||
|
||
dispatch('/two', 'index_two'); | ||
function index_two() | ||
{ | ||
flash('notice', 'ON DISPLAY 3'); | ||
return html('<p>Hellooo!</p>'); | ||
} | ||
dispatch('/three', 'index_three'); | ||
function index_three() | ||
{ | ||
flash('error', 'ON DISPLAY 4'); | ||
return html('<p>Hellooo!</p>'); | ||
} | ||
dispatch('/four', 'index_four'); | ||
function index_four() | ||
{ | ||
return html('<p>NO FLASH MESSAGE ON NEXT PAGE</p>'); | ||
} | ||
dispatch('/five', 'index_five'); | ||
function index_five() | ||
{ | ||
flash('error', 'ON DISPLAY 6'); | ||
redirect_to('six'); | ||
} | ||
dispatch('/six', 'index_six'); | ||
function index_six() | ||
{ | ||
return html('<p>REDIRECTED FROM INDEX FIVE...</p><p>There will be no flash message on next page.</p>'); | ||
} | ||
|
||
|
||
|
||
run(); | ||
|
||
# _INLINE templates___________________________________________________________ | ||
|
||
function html_default_layout($vars){ extract($vars);?> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<title>Flash features test</title> | ||
</head> | ||
<body> | ||
<article> | ||
<?=$content;?> | ||
|
||
<?php if(!empty($flash)): ?> | ||
<section> | ||
<h2>Current flash messages ( flash_now() / $flash )</h2> | ||
<pre><code> | ||
<?= var_dump(flash_now()); ?> | ||
</code></pre> | ||
</section> | ||
<?php endif; ?> | ||
</article> | ||
<hr> | ||
<nav> | ||
<p><strong>Menu:</strong> | ||
<a href="<?=url_for('/')?>">One</a> | | ||
<a href="<?=url_for('two')?>">Two</a> | | ||
<a href="<?=url_for('three')?>">Three</a> | | ||
<a href="<?=url_for('four')?>">Four</a> | | ||
<a href="<?=url_for('five')?>">Five</a> | | ||
<a href="<?=url_for('six')?>">Six</a> | ||
</p> | ||
</nav> | ||
</body> | ||
</html> | ||
<?}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters