tp5 mvc + codeigniter v3

This commit is contained in:
2026-05-05 08:47:04 +02:00
parent 691f55f9d0
commit 78caabe3f1
12 changed files with 406 additions and 0 deletions
@@ -0,0 +1,33 @@
<?=validation_errors(); ?>
<?=form_open('user/create')?>
<!-- Grid -->
<div class="grid">
<!-- Markup example 1: input is inside label -->
<label for="prenom">
Prénom
<input type="text" id="prenom" name="prenom" placeholder="Prénom" value="<?=set_value('prenom')?>"required>
</label>
<label for="nom">
Nom
<input type="text" id="nom" name="nom" placeholder="nom" value="<?=set_value('nom')?>" required>
</label>
</div>
<!-- Markup example 2: input is after label -->
<label for="email">Adresse mail</label>
<input type="email" id="email" name="email" placeholder="Email" value="<?=set_value('email')?>" required>
<div class="grid">
<label for="password">Password
<input type="password" id="password" name="password" placeholder="Password" value="<?=set_value('password')?>" required>
</label>
<label for="password">Confirmation password
<input type="password" id="cpassword" name="cpassword" placeholder="Password" value="<?=set_value('cpassword')?>" required>
</label>
</div>
<!-- Button -->
<button type="submit">Submit</button>
</form>
+13
View File
@@ -0,0 +1,13 @@
<article>
<?php echo form_open("/todo/edit/{$todo->id}");?>
<form>
<label for="email">Todo
<input type="text" name="todo" value="<?=set_value('todo',$todo->text)?>" required>
</label>
<!-- Button -->
<button type="submit">Submit</button>
</form>
</article>
@@ -0,0 +1,3 @@
</main>
</body>
</html>
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>TODO APP</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css"
/>
<!--link rel="stylesheet" href="https://unpkg.com/@picocss/pico@1.*/css/pico.min.css"-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<?=link_tag('assets/style.css')?>
</head>
<body>
<main class="container">
+39
View File
@@ -0,0 +1,39 @@
<article>
<header>
<nav>
<ul>
<li><strong>TODOS</strong></li>
</ul>
<ul>
<li><?=anchor("todo/?filter=all",'All',['role'=>($filter=='all'?'button':'')])?></li>
<li><?=anchor("todo/?filter=active",'Active',['role'=>($filter=='active'?'button':'')])?></li>
<li><?=anchor("todo/?filter=done",'Done',['role'=>($filter=='done'?'button':'')])?></li>
</ul>
</nav>
</header>
<?=form_open('todo/add')?>
<input type="text" placeholder="todo" name="todo">
</form>
<table>
<?php foreach($todos as $todo): ?>
<?php if ($todo->done): ?>
<tr>
<td><s><?=$todo->text?></s></td>
<td class='action'>
<?=anchor("todo/toggle/{$todo->id}", '<i class="fa fa-toggle-on"></i>')?>
<?=anchor("todo/delete/{$todo->id}", '<i class="fa fa-trash-o"></i>')?>
<?=anchor("todo/edit/{$todo->id}", '<i class="fa fa-edit"></i>')?>
<?php else: ?>
<tr><td><?=$todo->text?></td>
<td class='action'>
<?=anchor("todo/toggle/{$todo->id}", '<i class="fa fa-toggle-off"></i>')?>
<?=anchor("todo/delete/{$todo->id}", '<i class="fa fa-trash-o"></i>')?>
<?=anchor("todo/edit/{$todo->id}", '<i class="fa fa-edit"></i>')?>
<?php endif; ?>
</td></tr>
<?php endforeach; ?>
</table>
</article>