Files
mahak-authenticate-bridge/src/app/Http/Controllers/SettingsPageMenuController.php
T

33 lines
967 B
PHP

<?php
namespace Dabestaniha\AuthenticateBridge\App\Http\Controllers;
class SettingsPageMenuController extends InvocableController
{
public function __invoke()
{
add_options_page(
config('mahak.translations.settings-page-title'),
config('mahak.translations.settings-page-menu'),
'manage_options',
config('mahak.settings-page'),
fn() => $this->mahak_authenticate_settings_page(),
);
}
function mahak_authenticate_settings_page(): void
{
?>
<div class="wrap">
<h1><?= config('mahak.translations.settings-page-title') ?></h1>
<form method="post" action="options.php">
<?php
settings_fields(config('mahak.settings-group'));
do_settings_sections(config('mahak.settings-page'));
submit_button();
?>
</form>
</div>
<?php
}
}