D
D
dim4ik2015-06-22 19:13:13
Kohana
dim4ik, 2015-06-22 19:13:13

How are nested queries implemented in Laravel like in kohana?

The site page consists of different blocks. A block of popular posts, a block of popular users....
There is such a thing as nested queries in Kohana, and they were implemented in the controller like this:

$content->TopPosts = Request::factory( 'post/top/' )->execute()->body();
$content->TopUsers = Request::factory( 'users/top/' )->execute()->body();
// А переменные $TopPosts и $TopUsers просто выводились в основном шаблоне template.php
echo @$TopPosts; 
....
echo @$TopUsers;

How is this done in Laravel?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2015-06-22
@dim4ik

Apparently you need view composers

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question