V
V
Vitaliy24102017-10-04 15:04:02
Laravel
Vitaliy2410, 2017-10-04 15:04:02

How to connect nested controller in Laravel v5?

Hello, I started learning Laravel, I can’t figure out how to distribute the header, footer controllers and connect them on each page, I figured out how to connect their view, but I want the information ($ data) that is passed to the view to go from the right one controller. There is such an implementation in opencart 2.x. There is a page controller in which the header and footer controllers are connected, and the connection itself returns the result of the work of the connected class method. $data['footer'] = $this->load->controller('common/footer'); $data['header'] = $this->load->controller('common/header');
and now import this data in the desired form. I hope I made it clear what you need help with.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2017-10-04
@Vitaliy2410

Use templates for header and footer output.
And display data using shared view: https://laravel.com/docs/5.5/views#sharing-data-wi...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question