Home  >  Article  >  Backend Development  >  yii uses renderPartial to call the view of another controller_PHP tutorial

yii uses renderPartial to call the view of another controller_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:29:59954browse

The following are some of the experiences we gained when developing projects at Xinyi Network company

We can use renderPartial to access partial view files stored in the views folder of a different controller.

In Yii1.1.3, we use double slashes "//", and the program will start searching from the view folder, for example:

protected/views/library/_book.php
renderPartial('//library/_book', array('books'=>$books))

If you use a single slash "/" to start the search, the program will jump out of the current active module and search from the application's view path.

This article is published by Xinyi Network, which specializes in website construction in Chengdu. For more information about yii, please pay attention to Xinyi Network’s subsequent releases. Xinyi Network’s official website is http://www.ir58.com

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/768208.htmlTechArticleThe following is some experience we gained when developing projects at Xinyi Network Company. We can use renderPartial to access the storage in Partial views in view folders of different controllers...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn