Skip to content

Instantly share code, notes, and snippets.

@silentworks
Created December 9, 2011 18:33
Show Gist options
  • Save silentworks/1452729 to your computer and use it in GitHub Desktop.
Save silentworks/1452729 to your computer and use it in GitHub Desktop.
Twig and Slim integration task index file
{% extends "base.html" %}
{% block content %}
<h1>Tasks</h1>
<ul>
<?php foreach ($tasks as $task): ?>
<li><a href="<?php echo Slim::getInstance()->urlFor('task_edit', array('id' => $task->id)); ?>"><?php echo $task->name; ?></a> <a href="<?php echo Slim::getInstance()->urlFor('task_delete', array('id' => $task->id)); ?>">Delete</a></li>
<?php endforeach; ?>
</ul>
<form action="<?php echo Slim::getInstance()->urlFor('task_new'); ?>" method="post">
<input type="submit" value="Add Task" />
</form>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment