modifiedcontent Posted January 1, 2020 Share Posted January 1, 2020 Another dumb question; what am I supposed to do with the following in config.php: Quote /** @var Config $config */ /** * Allow core API variables to also be accessed as functions? * * Recommended. This enables API varibles like $pages to also be accessed as pages(), * as an example. And so on for most other core variables. * * Benefits are better type hinting, always in scope, and potentially shorter API calls. * See the file /wire/core/FunctionsAPI.php for details on these functions. * * @var bool * */ I have tried uncommenting '@var Config $config', but that breaks stuff. And what is '@var bool'? Link to comment Share on other sites More sharing options...
qtguru Posted January 1, 2020 Share Posted January 1, 2020 @ is not supported in PHP only in comments and sometimes PHPDoc, however your IDE also uses that to resolve $config to a Config class for Intellisense purposes. Check this link for more information https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc.md 2 Link to comment Share on other sites More sharing options...
gmclelland Posted January 1, 2020 Share Posted January 1, 2020 I think this might help you https://processwire.com/api/ref/functions/#pwapi-methods-Functions-API 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now