且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 CakePHP 中使用数据库值填充下拉列表

更新时间:2023-02-01 11:20:09

您在数据库中进行查找,然后通过控制器中的 $this->set(yourvariable) 设置变量.

You make a find in the db and then set the variable via $this->set(yourvariable) in the controller.

在视图中,您在 select 标签中使用yourvariable"

In the view you use the "yourvariable" in the select tag

填写选择 1

填充选择 2

填充选择 3