< Back

Write-PodeViewResponse

Sat Jan 18, 2020 7:22 pm

NAME Write-PodeViewResponse



SYNOPSIS

Renders a dynamic, or static, View on the Response.





SYNTAX

Write-PodeViewResponse [-Path] <String> [[-Data] <Hashtable>] [[-StatusCode] <Int32>] [-FlashMessages]

[<CommonParameters>]





DESCRIPTION

Renders a dynamic, or static, View on the Response; allowing for dynamic data to be supplied.





PARAMETERS

-Path <String>

The path to a View, relative to the "/views" directory. (Extension is optional).



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Data <Hashtable>

Any dynamic data to supply to a dynamic View.



Required? false

Position? 2

Default value @{}

Accept pipeline input? false

Accept wildcard characters? false



-StatusCode <Int32>

The status code to set against the response.



Required? false

Position? 3

Default value 200

Accept pipeline input? false

Accept wildcard characters? false



-FlashMessages [<SwitchParameter>]

Automatically supply all Flash messages in the current session to the View.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Write-PodeViewResponse -Path 'index'













-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Write-PodeViewResponse -Path 'accounts/profile_page' -Data @{ Username = 'Morty' }













-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Write-PodeViewResponse -Path 'login' -FlashMessages















RELATED LINKS