<?php
$this->title = $model->id;
?>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My Title </title> <!-- this is for SEO -->
...
</head>
<body>
<h1><?= $this->title ?> </h1> <!-- this is for user view -->
2条答案
按热度按时间ogq8wdun1#
在视图中,该值被分配给$this-〉title,以便在head中使用,并且如果在用户视图中有用
zy1mlcev2#
设置title变量。示例:
然后在视图或布局文件中使用title变量。例如:
此处