Z
Z
Zarathustraa2016-07-14 16:50:07
Laravel
Zarathustraa, 2016-07-14 16:50:07

How to get string representation (laravel 4.2)?

Please tell me how in laravele 4.2. Is it possible to get the result of the view execution as a string (html code) from the controller? To respond to an ajax request.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
miki131, 2016-07-14
@Zarathustraa

$view = View::make('master', ['key' => 'value']);
$html = $view->render();

Александр Аксентьев, 2016-07-14
@Sanasol Куратор тега Laravel

Лучше так не делать.
Передавайте данные, а не html.
https://laravel.com/docs/4.2/responses

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question