Home> PHP Framework> YII> body text

How to introduce other templates into the content template page in yii2

王林
Release: 2020-02-17 14:31:42
Original
1871 people have browsed it

How to introduce other templates into the content template page in yii2

In the view file, such as the view file of user.php.

urlManager; $this->title = '业务员列表'; $this->params['active_nav_group'] = 2; ?> 
title ?>
$val) : ?>
ID 手机 姓名 绑定用户 修改时间 操作
render('@app/views/layouts/paginator.php',['pagination'=>$pagination]);?>
Copy after login

(Related tutorial recommendation:yii framework)

Use:

render('@app/views/layouts/paginator.php',['pagination'=>$pagination]);?>
Copy after login

for introduction. It should be noted that the output statement is used before render. Echo displays the content of the subtemplate. The parameters are used in the same way as in the action. The @app template variable represents the main folder.

The sub-template code is as follows:

 
totalCount ?>条数据
Copy after login

For more programming-related content, please pay attention to theProgramming Tutorialcolumn of the php Chinese website!

The above is the detailed content of How to introduce other templates into the content template page in yii2. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!