Last active
August 29, 2015 14:16
-
-
Save isapir/e75f1dc508b1bac1da5c to your computer and use it in GitHub Desktop.
testcase for mailing list discussion re: custom tags hierarchy
This file contains hidden or 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
| component { | |
| /** cfc custom tag init( boolean hasEndTag, component parent ) */ | |
| function init( boolean hasEndTag, component parent ) { | |
| this.name = listFirst(listLast(getCurrentTemplatePath(), '\/'), '.'); | |
| this.parent = arguments.parent ?: "{no-parent}"; | |
| return this; | |
| } | |
| /** cfc custom tag onStartTag( struct attributes, struct caller ):boolean */ | |
| boolean function onStartTag( struct attributes, struct caller ) { | |
| if (isSimpleValue(this.parent)) | |
| echo("<p><br><br>"); | |
| echo("<p>"); | |
| echo(this.name); | |
| echo("<span style='background-color:yellow; margin:1em; padding:0.5em;'>parent: "); | |
| echo(isSimpleValue(this.parent) ? this.parent : listLast(getMetaData(this.parent).name, '.')); | |
| echo("</span>"); | |
| return true; | |
| } | |
| } |
This file contains hidden or 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
| component extends="Tag" {} |
This file contains hidden or 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
| component extends="Tag" {} |
This file contains hidden or 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
| component extends="Tag" {} |
This file contains hidden or 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
| component extends="Tag" {} |
This file contains hidden or 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
| <cf_Tag1> | |
| <cf_Tag2> | |
| <cf_Tag3> | |
| <cf_Tag4> | |
| </cf_Tag3> | |
| </cf_Tag2> | |
| </cf_Tag1> | |
| <cf_Tag2> | |
| <cfloop from="1" to="3" index="ii"> | |
| <cfoutput> | |
| <cf_Tag4> | |
| </cfoutput> | |
| </cfloop> | |
| </cf_Tag2> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment