Home > Article > Backend Development > yii uses renderPartial to call the view of another controller_PHP tutorial
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