Dav*_*ong 6 coldfusion getter-setter coldfusion-10
我开始玩ColdFusion 9中添加的新cfproperty东西,但我想要使用的主要部分现在似乎在ColdFusion 10中不起作用.我创建了以下CFC:
component displayName="Sources" {
/**
* @getter true
* @setter true
* @type numeric
* @default 1
**/
property sourceid;
/**
* @getter true
* @setter true
* @type numeric
* @default 1
**/
property sourcegroup;
public any function init () {
This.domainRegex = '\/\/(www\.)?(([A-Za-z0-9\-_]+\.?)+)';
return this;
}
}
Run Code Online (Sandbox Code Playgroud)
当我转储CFC的元数据时,我可以看到属性,但没有为它们创建方法,我无法调用getSourceId()
或getSourceGroup()
Sea*_*yne 10
试试这个:
component accessors="true" displayName="Sources" {
property name="sourceid" type="numeric" default="1";
property name="sourcegroup" type="numeric" default="1";
public any function init () {
this.domainRegex = '\/\/(www\.)?(([A-Za-z0-9\-_]+\.?)+)';
return this;
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
861 次 |
最近记录: |