thinkphp how to render two V-layer stencil views in the same function?

Source: Internet
Author: User
I would like to use a different template, a set of templates called Red, another set called read.

public function addData(){    $this->theme( 'red' )->display( 'form' );            $this->theme( 'read' )->display( 'addData' );    //这个使用了不同的模版文件,    //但是他把不识别,还是从上一句的 red 模版找 addData.html 文件 ...}

Reply content:

I would like to use a different template, a set of templates called Red, another set called read.

public function addData(){    $this->theme( 'red' )->display( 'form' );            $this->theme( 'read' )->display( 'addData' );    //这个使用了不同的模版文件,    //但是他把不识别,还是从上一句的 red 模版找 addData.html 文件 ...}

It's useless. In fact, you display inside the content directly with the stitching is not good. $this->display (folder + file), this way to render, you template folder is not the same, should be able to solve the problem.

Using AJAX asynchronous calls to assemble two templates into one

public function addData(){     $result = [];     $result['red']= $this->fetch('Member:red');     $result['read']= $this->fetch('Member:read');     return $this->ajaxReturn($result);}
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.