Sorry, rusty at PHP and learning Craft.
My code looks like this:
$url = craft::$app->GeneralConfig->siteUrl();
What am I doing wrong? I want to build a URL for some links in a plugin.
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It only takes a minute to sign up.
Sign up to join this communitySorry, rusty at PHP and learning Craft.
My code looks like this:
$url = craft::$app->GeneralConfig->siteUrl();
What am I doing wrong? I want to build a URL for some links in a plugin.
Please use a proper IDE or take a look into the source code to get to know the functions of the class. As you can see in the class reference the function is called
Craft::$app->getConfig()
However - in order to create urls you should use the UrlHelper
Craft::
you'll see every possibility you have. No plugin needed, no real setup needed
– Robin Schambach
Apr 9 '18 at 5:29