Craft\AmForms_SettingsController::actionShowSettings PHP Method

actionShowSettings() public method

Show settings.
public actionShowSettings ( array $variables = [] )
$variables array
    public function actionShowSettings(array $variables = array())
    {
        // Do we have a settings type?
        if (!isset($variables['settingsType'])) {
            throw new Exception(Craft::t('Settings type is not set.'));
        }
        $settingsType = $variables['settingsType'];
        // Do we have any settings?
        $settings = craft()->amForms_settings->getAllSettingsByType($settingsType);
        if (!$settings) {
            throw new Exception(Craft::t('There are no settings available for settings type “{type}”.', array('type' => $settingsType)));
        }
        // Show settings!
        $variables['type'] = $settingsType;
        $variables[$settingsType] = $settings;
        $this->renderTemplate('amForms/settings/' . $settingsType, $variables);
    }