Hi,
I would just pass/attach one or many objects to my component 'default.htm' view from the method onRun() (or onRender maybe?) of this same component. How can I do that?
I would something simply like from a Laravel controller:
return view('my.view', compact('my_var_1', 'my_var_2', 'my_var_3'));
So, I tried...
public onRun()
{
$myObject = MyModel::where('id', 1)->with('a_related_model')->get();
$this->page['something'] = $myObject;
}
And...
{{ dump(something) }}
{{ something.id }}
{{ something.slug }}
{{ something.title }}
or...
{% for something in somethings %}
{{ something.value }}
{% endfor %}
...
Nothing works (except 'user' accessible from any view). Unfortunately official documentation is too vague about this point, or there's a subtlety I didn't understand about the components...
Thanks for help.
Last updated