F
Filamentβ€’4mo ago
Zombiezach8

SimplePage render custom view data?

Hello, I'm trying to create a SimplePage that non-logged in users can view. I'm just having a issue where the data set in
getViewData()
getViewData()
or a custom
render()
render()
function is not showing up to the view? I've tried ovewriting the following and everything works except passing in data. I even tried just putting the data manually where $this->getViewData() is. I know I can use $this->variableName but I'd really not like to do that since people can see that data right? I just want to render some data.
public function render(): View
{
return view(self::$view, $this->getViewData())
->layout(self::$layout, [
'livewire' => $this,
'maxContentWidth' => 'full',
...[],
]);
}
public function render(): View
{
return view(self::$view, $this->getViewData())
->layout(self::$layout, [
'livewire' => $this,
'maxContentWidth' => 'full',
...[],
]);
}
TDLR: Passing data to render() is not working but manually entering the data variables in mount() works.
2 Replies
LeandroFerreira
LeandroFerreiraβ€’4mo ago
could you share the whole code?
Zombiezach8
Zombiezach8OPβ€’4mo ago
Fixed, sorry. Apparently having a public variable with the same name overwrites any data passed into the render data. Completely overlooked that πŸ™‚
Want results from more Discord servers?
Add your server