I have a "config" file where I define...
I have been using this Constant with great success over the past year or so.Code:// Base URL (**Virtual Location) define('BASE_URL', ENVIRONMENT === 'development' ? 'http://local.debbie' : 'http://www.MySite.com');
However, now I want to incorporate it into a Function that I am working on, and I'm not sure how its scope works?!![]()
Here is my current Function...
PHP Code:function generateURL($section){
$url = 'http://local.debbie/' . $section . '/articles/';
return $url;
}
What do I need to do to replace that static URL with reference to my Constant so that when I switch between "Development" and "Production", everything still works"
Can my Constant - defined in my "config" file - be seen INSIDE my Function? (Or do I need to pass it into the Function? Or something else?)
Thanks,
Debbie



Reply With Quote





$articleBaseUrl works.

Bookmarks