在 CFWheels 应用程序中传递动态数据时出错

问题描述 投票:0回答:0

我正在学习如何创建 CFWheels 应用程序。我已经按照他们的文档设置了我的CFWheels应用程序。

在我的Controller中,我有这段代码

component extends="Controller" {
    function hello() {
    }
}

在我的view中,我有这段代码

<h1>Hello World!</h>

本地主机网址:http://127.0.0.1:60000/say/hello

hello world!
显示正确,但每当我在控制器中添加动态数据时,我都会得到 variable not defined

这里是我的 Controller 的修改,我在其中使用系统函数传递当前时间

component extends="Controller" {
    function hello() {
        time: Now()
    }
}

更新查看

<h1>Hello World!</h>
<p>Current time: <cfoutput>#time#</cfoutput></p>

输出

Lucy:没有定义 [Time] 变量。请帮忙

cfml cfwheels
© www.soinside.com 2019 - 2024. All rights reserved.