Forum

Thread tagged as: Question, Api

Accessing Settings API at runtime

How do I access Settings API at runtime within normal site pages?

Do I need to make include the settings class before:

$Settings = $API->get('Settings');
$Settings->get('my_app_editorMayDeleteStuff')->settingValue();
Daniel Ruffle

Daniel Ruffle 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is that not working?

Nope, I get the following errors

Notice: Undefined variable: API in checkout.php on line 88

Fatal error: Call to a member function get() on a non-object in checkout.php on line 88

Line 88 being the $Settings = $API->get('Settings');

Drew McLellan

Drew McLellan 2638 points
Perch Support

You do need an instance of the API.