我想从parameters.yml读取一个pareameter。 解决方案是扩展Controller但我收到此错误 : p>
错误:在null上调用成员函数getParameter() pre>
我知道容器是 null,但我不知道如何获取容器? p>
class Configuration extends Controller
{
public function __construct()
{
$ this- > tempFolderPath = sys_get_temp_dir();
$ parameter = $ this-> container-> getParameter('a');
}
}
code> pre>
< p>任何解决方案? 有什么帮助吗? p>
div>