Nette Framework 2.2.0 released!
Notice: This thread is very old.
- David Grudl
- Nette Core | 8228
I'd like to announce the Nette Framework 2.2.0, the biggest revolution in its history.
Nette has been split into small projects Application, Bootstrap, Caching, ComponentModel, Nette Database, DI, Finder, Forms, Http, Latte, Mail, Neon, PhpGenerator, Reflection, RobotLoader, SafeStream, Security, Tokenizer, Tracy and Nette Utils.
It also brings complete new Latte API for standalone usage:
$latte = new Latte\Engine;
$latte->setTempDirectory('/path/to/cache');
$latte->addFilter('money', function($val) { return ...; }); // formerly registerHelper()
$latte->onCompile[] = function($latte) {
$latte->addMacro(...); // when you want add some own macros, see http://goo.gl/d5A1u2
};
$latte->render('template.latte', $parameters);
// or $html = $latte->renderToString('template.latte', $parameters);
Also Nette\Diagnostics was renamed to nice and short Tracy.
You can, as usual, download complete package or install it via Composer.
- janpecha
- Backer | 75
@tpr Only way now is using of “fake” presenter:
<?php
class FakePresenter extends Nette\Application\UI\Presenter
{
public function findLayoutTemplateFile()
{
return "/path/to/layout";
}
}
$presenter = new FakePresenter;
$latte = new Latte\Engine;
$latte->render(..., array(
'_control' => $presenter,
));
?>
You can use own UI\Presenter, not only from nette/application package:
<?php
namespace Nette\Application\UI;
if (!class_exists('Nette\Application\UI\Presenter')) {
class Presenter
{
}
}
?>