开发者

Variables missing from vendors directory in CakePHP

开发者 https://www.devze.com 2023-03-31 06:15 出处:网络
I copied some lib files into the vendors directory开发者_StackOverflow of CakePHP. And used App::import to import the provided lib files.

I copied some lib files into the vendors directory开发者_StackOverflow of CakePHP. And used App::import to import the provided lib files.

I can initialize the Classes defined in the lib files, which means I've imported the files successfully. However, the global variables defined in the lib files cannot be used in the controller. As the notice says, the variables are undefined.

How would I access the variables in the lib files from the controller?


It's bad practice to just stick global variables into a file like that and trying to include them.

You should abstract the variables out to a class, or find a way around them all together.

0

精彩评论

暂无评论...
验证码 换一张
取 消