Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I insert output from othermodules/controllers in a view

I have a view and I want to display data that would be generated by othe modules and controllers on the page.

What is the best way to do this?

For example: If on a certain page I want to pull in the latest news from the news module.

like image 706
Jesse Lesperance Avatar asked Feb 26 '26 20:02

Jesse Lesperance


1 Answers

There's a view helper called Action which allows you to call another controller's action (and display the markup generated).

I would add an action called latestNewsAction that renders a latest news panel/div/list and call that using the action view helper.

like image 73
David Snabel-Caunt Avatar answered Mar 01 '26 10:03

David Snabel-Caunt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!