Integration of Blazor and PeachPie enables executing PHP scripts on a client side without additional requests to a server. The integration comprises
Peachpie.Blazor.Sdk providing helper structures to make PHP a valuable part of client side web development. Everything is built on top of the Blazor platform, so you don't need any browser extensions.
- Install Peachpie.Templates by
dotnet new -i "Peachpie.Templates::*"
- Choose the template based on your intention:
- blazor-hybrid- A simple PHP website running in browser
- blazor-web - A simple Blazor website combining PHP and Razor Pages
- Create the project by
dotnet new project-name
- Add Razor pages to BlazorApp.Client or PHP scripts to PHPScripts (Optional)
- Launch the Blazor.Server by
dotnet run --project BlazorApp\Server
- Access https://localhost:5001
You can see a simple PHP web application, which is created as a Peachpie project and downloaded to a client by only one initial request below. The next navigation in the website is offline, using the Blazor environment.
- The integration provides a lot of advanced features like JS PHP interoperability or transparent evaluating of web forms without request to a server.
- There are many user scenarios, which are interesting and can be found in the examples.
- See also other documentation files describing all features of the library.