geniv / nette-macros
Latte macros extension for Nette Framework
Installs: 1 061
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.6.0
- nette/nette: >=2.4.0
README
Latte macros
Installation
$ composer require geniv/nette-macros
or
"geniv/nette-macros": ">=1.0.0"
require:
"php": ">=5.6.0", "nette/nette": ">=2.4.0"
Include in application
neon configure:
extensions: - Macros\Bridges\Nette\Extension
IfCurrent (n:class="$presenter->linkCurrent ? ..."):
<div n:ifCurrent="Homepage:default">aktivni sekce Homepage:default</div> {ifCurrent 'Homepage:default'}aktivni sekce Homepage:default{/ifCurrent}
IfCurrentIn:
<div n:ifCurrentIn="'News:default', 'Homepage:default'">Hello, n:macro</div> {ifCurrentIn 'News:default', 'Homepage:default'}Hello, standart macro{/ifCurrentIn}
IfCurrentSwitch:
{ifCurrentSwitch} {ifCurrentCase 'Homepage:default'} layout-variant-hp {ifCurrentCase 'Homepage:vzor'} layout-variant-location {ifCurrentDefault} layout-variant-sub {/ifCurrentSwitch}
SubmitButton:
{form formName} {button controlName, class=>"btn"} <i class="icon icon-ok"></i> {caption} {/button} {/form} {form formName} {button $_form['controlName'], class=>"btn"} <i class="icon icon-ok"></i> {caption} {/button} {/form}
Confirm:
<a href="..." n:confirm="'Really delete?'">delete</a> <a href="..." n:confirm="$presenter->translator->translate('translate-confirm')">delete</a>
DataStream:
{dataStream}/www/images/logo.png{/dataStream}
if image does not exist then result null