更改页面的内容标题 [英] Change the content title of the page

查看:40
本文介绍了更改页面的内容标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Yii 框架视图页面中,我有面包屑,在它的正下方是内容部分.现在根据我的要求,我希望内容标题应该在面包屑上方.现在更改内容部分并提取内容我看到内容部分只有这个<?php echo $content;?>.

In Yii framework view page I have the breadcrumb and just below it the content part is there.Now as per my requirment I want the content title should come above the breadcrumb.Now to change the content part and to extract the title of the content I saw that the content part has only this <?php echo $content; ?>.

那么如何提取标题并将面包屑部分放在该部分下方?

So how to extract the title and place the breadcrumb part below that part?

推荐答案

布局!关于如何呈现面包屑/标题的所有解释(在 echo $content 之后/之前),都在 http://www.yiiframework.com/wiki/249/understanding-the-view-rendering-flow/.

Layouts! All the explanation on how the breadcrums/title are rendered (after/before the echo $content), is in http://www.yiiframework.com/wiki/249/understanding-the-view-rendering-flow/.

在布局中,使用$this->标题的pageTitle

In layouts, use $this->pageTitle for title

$this->面包屑的面包屑

$this->breadcrumbs for breadcrums

对于面包屑小部件,请参见示例:$this->widget('zii.widgets.CBreadcrumbs', array('links'=>$this->breadcrumbs,));?>

For breadcrums widget, see example: $this->widget('zii.widgets.CBreadcrumbs', array( 'links'=>$this->breadcrumbs,)); ?>

这篇关于更改页面的内容标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆