访问 CakePHP 烘焙脚本中的变量数组?
我正在尝试修改 CakePHP 烘焙脚本,以便可以将图像助手中的图像保存合并到适当命名的字段中。
如何获取模型中的字段/变量列表?我看到 $modelObj 对象可用,我尝试对此执行 json_encode 以了解里面的内容,并且有一个“_schema”列表,其中似乎包含我所有的字段名称...但我无法访问因为它不是数组?
I'm trying to modify the CakePHP bake script so that I can incorporate saving of images from an image helper in an appropriately named field.
How do I go about getting the list of fields/variables in my model? I see that the $modelObj object is available, I've tried performing json_encode on this to get an idea for what's inside and theres a "_schema" list which seems to have all my field names inside... but I can't access this as it's not an array?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
调用:
它将返回包含字段名称和数据类型的逐字段列表。
Make a call to:
It will return a field-by-field list containing field names and data types.