摘要: Ext.onReady(function(){new Ext.Viewport({layout:"border",items:[{region:"north",height:50,title:"顶部面板"},{region:"south",height:50,title:"底部面板"},{region:"center",title:"中央面板"},{region:"west",width:100,... 阅读全文
posted @ 2010-01-12 14:33 蔡剑锋 阅读(312) 评论(0) 推荐(0)
摘要: Ext.onReady(function(){var panel=new Ext.Panel({renderTo:"hello",title:"容器组件",width:500,height:200,layout:"table",layoutConfig: {columns: 3},items:[{title:"子元素1",html:"这是子元素1中的内容",rowspan:2,height:100... 阅读全文
posted @ 2010-01-12 14:32 蔡剑锋 阅读(239) 评论(0) 推荐(0)
摘要: #stop script element允许模板设计者停止执行模板引擎并返回。把它应用于debug是很有帮助的。#stop这个语法很简单,就是让程序在这里停止! 阅读全文
posted @ 2010-01-12 14:29 蔡剑锋 阅读(176) 评论(0) 推荐(0)
摘要: #macro script element允许模板设计者定义一段可重用的VTL template。Velocimacros广泛用于简单和复杂的行列。Velocimacros的出现是为了减少编码和极小化排版错误,对Velocimacros的概念提供一个介绍。#macro( d )<tr><td></td></tr>#end在上面的例子中Velocima... 阅读全文
posted @ 2010-01-12 14:27 蔡剑锋 阅读(1310) 评论(0) 推荐(0)
摘要: math在模板中可以使用Velocity内建的算术函数,如:加、减、乘、除。下面的等式分别是:加、减、乘、除:#set( $foo = $bar + 3 )#set( $foo = $bar - 4 )#set( $foo = $bar * 6 )#set( $foo = $bar / 2 )当执行除法时将返回一个Integer类型的结果。而余数你可以使用%来得到:#set( $foo = $ba... 阅读全文
posted @ 2010-01-12 14:26 蔡剑锋 阅读(178) 评论(0) 推荐(0)
摘要: #parse script element允许模板设计者一个包含VTL的本地文件。Velocity将解析其中的VTL并render模板。#parse( "me.vm" ) 还可以直接#parse("xxx.htm")就像#include,#parse接受一个变量而不是一个模板。任何由#parse指向的模板都必须包含在TEMPLATE_ROOT目录下。与#include不同的是,#parse只能指定... 阅读全文
posted @ 2010-01-12 14:24 蔡剑锋 阅读(574) 评论(0) 推荐(0)
摘要: Velocity中使用等号操作符判断两个变量的关系。这里有个简单例子关于等于号的使用:#set ($foo = "deoxyribonucleic acid")#set ($bar = "ribonucleic acid")#if ($foo == $bar) In this case it's clear they aren't equivalent. So...#else They are n... 阅读全文
posted @ 2010-01-12 14:23 蔡剑锋 阅读(1021) 评论(0) 推荐(0)
摘要: Foreach循环#foreach 用于循环。例子:<ul>#foreach( $product in $allProducts ) <li>$product</li>#end</ul>每次循环$allProducts中的一个值都会赋给$product变量。$allProducts可以是一个Vector、Hashtable或者Array。分配给$pr... 阅读全文
posted @ 2010-01-12 14:23 蔡剑锋 阅读(248) 评论(0) 推荐(0)
摘要: If / ElseIf / Else 当一个web页面被生成时使用Velocity的#if directrive,如果条件成立的话可以在页面内嵌入文字。例如:#if( $foo ) <strong>Velocity!</strong>#end上例中的条件语句将在以下两种条件下成立:(i)$foo是一个boolean型的变量,且它的值为true;(ii)$foo变量的值不为n... 阅读全文
posted @ 2010-01-12 14:22 蔡剑锋 阅读(386) 评论(0) 推荐(0)
摘要: 应朋友们的要求,这里提供Expression Blend 2 正式中文版注册码,但要声明请大家使用正版软件,以上注册码仅提供参考请不要用于任何用途,否则一切后果由使用者承担。Expression Studio 下载地址:http://blog.csdn.net/dotfun/archive/2008/09/26/2983174.aspx注册码:TJ2R3-WHW22-B848T-B78YJ-HHJ... 阅读全文
posted @ 2010-01-12 10:03 蔡剑锋 阅读(494) 评论(0) 推荐(0)