Setting spaceless in presenter
- materix
- Backer | 83
I wrap all my @layout-latte-files with {spaceless}-tags. But while developing I like not to have spaceless enabled.
Is it possible to enable spaceless in a template from the presenter-class (e.g. using debug-mode), so I do not have to manually modify the latte-template-files?
- Marek Bartoš
- Nette Blogger | 1275
{if \Tracy\Debugger::$productionMode === true}
{include foo|spaceless}
{else}
{include foo}
{/if}
But probably not worth it. You will break space-sensitive code (like
<pre><code>
tags) and webserver should do fairly better
job compressing the page anyway.
Last edited by Marek Bartoš (2024-04-14 13:52)