Skip to content

Instantly share code, notes, and snippets.

@hhamon
Last active December 17, 2015 12:29
Show Gist options
  • Select an option

  • Save hhamon/5609617 to your computer and use it in GitHub Desktop.

Select an option

Save hhamon/5609617 to your computer and use it in GitHub Desktop.
<?php $view->extend('layout.php') ?>
<?php $view['slots']->set('title', 'Tasks Management') ?>
<form action="" method="post">
<div>
<label for="title">Title:</label>
<input type="text" id="title" name="title" size="45"/>
<input type="hidden" name="action" value="create"/>
<button type="submit">send</button>
</div>
</form>
<p>
There are <strong><?= $count ?></strong> tasks.
</p>
<table>
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($tasks as $todo) : ?>
<tr>
<td class="center"><?= $todo['id'] ?></td>
<td>
<a href="">
<?= $view->escape($todo['title']) ?>
</a>
</td>
<td class="center">
<?php if ($todo['is_done']) : ?>
<span class="done">done</span>
<?php else : ?>
<a href="">
close
</a>
<?php endif ?>
</td>
<td class="center">
<a href="">
delete
</a>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?php $view['slots']->output('title', 'Todo Application') ?></title>
<link rel="stylesheet" media="screen" type="text/css" href="/style.css"/>
</head>
<body>
<div id="container">
<h1>
<a href="">My Todos List</a>
</h1>
<div id="content">
<?php $view['slots']->output('_content') ?>
</div>
<div id="footer">
(c) copyright - not sensio
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment