File: article.latte

package info (click to toggle)
php-nette 2.4-20160731-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,208 kB
  • ctags: 7,552
  • sloc: php: 31,410; makefile: 6
file content (24 lines) | stat: -rw-r--r-- 610 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{url article/<id>}
{layout "@layout.latte"}

{var $article = $context->getByType('Nette\Database\Context')->table('article')->get($id) OR $presenter->error(404)}

{block content}
<p><a href="{$basePath}">← back</a></p>

<div class="article">
	<div class="date">{$article->created|date:'F j, Y'}</div>

	<h1 n:block="title">{$article->title}</h1>

	{$article->content|noescape}
</div>

<h2>Comments</h2>

<div class="comments">
{foreach $article->related('comment')->order('created') as $comment}
	<p><b>{$comment->name}</b> said…</p>
	{$comment->content|noescape}
{/foreach}
</div>