save_base_url()

public function save_base_url(): void

Description

Saves the user-confirmed base URL to the application's config/config.php file. Validates that a URL was provided, ensures it ends with a forward slash, and writes the BASE_URL constant to the config file.

This method is called internally by show_url_setup() on form submission and is blocked from direct URL access.

Parameters

This method takes no parameters. The URL value is retrieved from POST data via post('base_url', true).

Return Value

TypeDescription
voidRedirects back to the URL setup view on error, or to the application homepage on success.