© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•15mo ago•
9 replies
Ava

PHP inside of HtmlString?

I am trying to include the domain within the HtmlString but its a modal from a table. So each modal has its only domain.

->modalDescription(new HtmlString('Paste your Username from <a href="'. $record->url .'">'. $record->name .' </a>\'s user page' ) )
->modalDescription(new HtmlString('Paste your Username from <a href="'. $record->url .'">'. $record->name .' </a>\'s user page' ) )


If Vanilla PHP this is easily doable but that doesnt seem to be the case.
Solution
->modalDescription(function($record) { return new HtmlString(…); })
->modalDescription(function($record) { return new HtmlString(…); })
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Is there a way to use Heroicons inside HtmlString?
FilamentFFilament / ❓┊help
3y ago
Why HtmlString not work in filamentphp
FilamentFFilament / ❓┊help
2y ago
How to render SVG file on HTMLString
FilamentFFilament / ❓┊help
2y ago
********** React & PHP & Python **********
FilamentFFilament / ❓┊help
6mo ago