gpt4 book ai didi

coldfusion - Lucee - Coldfusion 新关键字不起作用

转载 作者:行者123 更新时间:2023-12-04 14:10:27 24 4
gpt4 key购买 nike

我正在尝试使用 new 调用一个组件关键字,但它不起作用。

下面的方法工作正常:

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

但是当我尝试使用以下内容时:
<cfset test = New test-objects.shipping_new(bar="Blah", foo="boom") />

我收到错误 tag cfset is not closed .上面的代码是我试图从中调用它的文件中的第一行,除非我遗漏了一些标签看起来对我来说很接近的东西。如果这有所作为,我将使用 Lucee 4.5。

最佳答案

问题是 hyphen :

If the folder name or CFC name has hyphen, use the following syntax:

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

关于coldfusion - Lucee - Coldfusion 新关键字不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36314703/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com