Skip to content

Commit

Permalink
compatibility with Latte 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jun 27, 2016
1 parent 23bc18b commit b575332
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CD-collection/app/presenters/templates/@layout.latte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<meta charset="utf-8">
<meta n:ifset="$robots" name="robots" content="{$robots}">

<title>{block title|striptags|trim}{/block} | Nette example</title>
<title>{block title|stripHtml|trim}{/block} | Nette example</title>

<link rel="stylesheet" media="screen" href="{$basePath}/css/site.css" />
</head>
Expand Down
2 changes: 1 addition & 1 deletion Fifteen/app/presenters/templates/Default.default.latte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</head>

<body>
<h1>Fifteen example &ndash; {snippet round <span>}round #{$presenter[fifteen]->round + 1}{/snippet}</h1>
<h1>Fifteen example &ndash; <span n:snippet=round>round #{$presenter[fifteen]->round + 1}</span></h1>

{snippet flash}<h2 n:ifset="$flash">{$flash}</h2>{/snippet}

Expand Down
4 changes: 2 additions & 2 deletions Micro-blog/www/data/TemplateRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct($path, $cachePath)
$latte = new Latte\Engine;
$latte->setTempDirectory($cachePath . '/cache');
$macroSet = new Latte\Macros\MacroSet($latte->getCompiler());
$macroSet->addMacro('url', function () {}); // ignore
$macroSet->addMacro('url', function () {}, NULL, NULL, $macroSet::ALLOWED_IN_HEAD); // ignore
return $latte;
})->setFile($file);
});
Expand All @@ -39,7 +39,7 @@ public function scanRoutes($path)
$macroSet = new Latte\Macros\MacroSet($latte->getCompiler());
$macroSet->addMacro('url', function ($node) use (&$routes, &$file) {
$routes[$node->args] = (string) $file;
});
}, NULL, NULL, $macroSet::ALLOWED_IN_HEAD);
foreach (Nette\Utils\Finder::findFiles('*.latte')->from($path) as $file) {
$latte->compile($file);
}
Expand Down
2 changes: 1 addition & 1 deletion Micro-blog/www/data/templates/@layout.latte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>{block title|striptags|trim}Homepage{/block} | Nette Framework Micro-blog example</title>
<title>{block title|stripHtml|trim}Homepage{/block} | Nette Framework Micro-blog example</title>
<link rel="stylesheet" media="screen" href="{$basePath}/style.css" />
</head>

Expand Down
4 changes: 2 additions & 2 deletions Modules-Usage/app/modules/Admin/templates/@layout.latte
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
</div>

<fieldset>
<legend>This is layout template <code>{$template->getName() |replace:$root}</code></legend>
<legend>This is layout template <code>{$this->getParentName() |replace:$root}</code></legend>

<fieldset>
<legend>This is content block template <code>{$presenter->template->getFile() |replace:$root}</code></legend>
<legend>This is content block template <code>{$this->getName() |replace:$root}</code></legend>
{include content}
</fieldset>

Expand Down
4 changes: 2 additions & 2 deletions Modules-Usage/app/modules/Front/templates/@layout.latte
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
</div>

<fieldset>
<legend>This is layout template <code>{$template->getName() |replace:$root}</code></legend>
<legend>This is layout template <code>{$this->getParentName() |replace:$root}</code></legend>

<fieldset>
<legend>This is content block template <code>{$presenter->template->getFile() |replace:$root}</code></legend>
<legend>This is content block template <code>{$this->getName() |replace:$root}</code></legend>
{include content}
</fieldset>

Expand Down

0 comments on commit b575332

Please sign in to comment.