简体   繁体   中英

Symfony render asynchronous content for Twig

How can i render the twig page in two steps ? First load only texts and then after finishing processing put also the data...

Example:

return $this->render('page.html.twig', ['text' => $text, 'data' => $data); 

But operation for preparing $data is too long.. so i would like to render page without $data , and after finishing process put data separately into page...

Is it possible please ?

Thanks for help

It is not possible but you can hack it. You should render without data Twig render. And send ajax request another to endpoint then get data variable into your page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM