Redirecting

You can redirect users in your actions using redirect().

component extends="cbwire.models.Component" {
    
    function redirectUser() {
        // Redirect to a URI
        redirect( "/some-uri" );
        // Redirect to a URL
        redirect( "https://www.google.com" );
        // Redirect using wire:navigate
        redirect( "/some-uri", true );
    }
}
<cfoutput>
    <div>
        <button wire:click="redirectUser">Redirect Me</button>
    </div>
</cfoutput>

Last updated