【发布时间】:2014-09-15 09:16:20
【问题描述】:
我正在尝试在 Padrino 中做一些基本的事情,但是很多搜索都没有找到任何答案。我正在尝试从模型访问全局设置。我在名为“endpoint”的environments.yaml 文件的“development”部分添加了一行,如何从模型类访问此设置? environment.yaml 是用于这种设置的最佳文件吗?
environments:
development:
endpoint: 'http://192.168.56.1:3001'
当我尝试在模型函数中使用“settings.endpoint”时,出现错误:
undefined local variable or method `settings' for Country:Class
【问题讨论】: