Created
March 23, 2011 20:45
-
-
Save vojtech-dobes/883924 to your computer and use it in GitHub Desktop.
First draft for UI abstraction - UiMacros for Nette Framework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{* | |
* All ui:* macros should support basic HTML attributes as modificators, | |
* because in fact they are only abstractions of common HTML elements | |
* compatible with proper unobtrusive javascript service. | |
*} | |
{* | |
* Basic link | |
* 'href' attribute is automatically evaluated as 'n:href' | |
*} | |
{ui:link href => ":Admin:Articles:delete!, $article->id", confirm => "Really wanna' delete this?"}delete{/ui:link} | |
{* | |
* Dialog popup | |
*} | |
{ui:dialog id => my-dialog, if => $showDialog, title => "New article", size => [60%, 300px], modal => TRUE} | |
<p>To create new article fill required fields please.</p> | |
{control addForm} | |
<p>* = unnecessary fields</p> | |
{/ui:dialog} | |
{* Dialogs can be defined on PHP side and provided to macro as variable. Still possible to set modificators... *} | |
{ui:dialog $dialog, if => $showDialog ... } | |
{* Link can be assigned to open dialog. *} | |
{ui:link launch => #my-dialog}show popup{/ui:link} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment