简体   繁体   English

Lucee - Coldfusion新关键字不起作用

[英]Lucee - Coldfusion new keyword not working

I am trying to invoke a component using the new keyword but it is not working. 我试图使用new关键字调用组件,但它无法正常工作。

The following method below works fine: 以下方法可以正常工作:

<cfset test = CreateObject("component", "test-objects.shipping_new").init(bar="Blah", foo="boom")>

But when I try to use the following: 但是当我尝试使用以下内容时:

<cfset test = New test-objects.shipping_new(bar="Blah", foo="boom") />

I get the error tag cfset is not closed . 我得到错误tag cfset is not closed The code above is the first line in the file I am trying to invoke it from, unless I am missing something the tag looks closed to me. 上面的代码是我试图从中调用它的文件的第一行,除非我遗漏了标记看起来对我不熟的东西。 I am using Lucee 4.5 if that makes a difference. 我正在使用Lucee 4.5,如果这有所作为。

The problem is the hyphen : 问题是连字符

If the folder name or CFC name has hyphen, use the following syntax: 如果文件夹名称或CFC名称具有连字符,请使用以下语法:

cfObject=new "cfc-path"(constructorParam1,...)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM